Skip to content

Commit

Permalink
Add definition for BX_CONFIG_DEBUG
Browse files Browse the repository at this point in the history
  • Loading branch information
exdal committed Oct 28, 2021
1 parent ec90e95 commit d3260f1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ install_manifest.txt
generated/*
!generated/*.in
cmake_install.cmake
.cache/
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ option( BGFX_INSTALL_EXAMPLES "Install examples and their runtimes." OF
option( BGFX_CUSTOM_TARGETS "Include convenience custom targets." ON )
option( BGFX_AMALGAMATED "Amalgamated bgfx build for faster compilation" OFF )
option( BX_AMALGAMATED "Amalgamated bx build for faster compilation" OFF )
option( BGFX_CONFIG_DEBUG "Enables debug configuration on all builds" OFF )
option( BGFX_CONFIG_RENDERER_WEBGPU "Enables the webgpu renderer" OFF )

set( BGFX_OPENGL_VERSION "" CACHE STRING "Specify minimum opengl version" )
Expand Down
6 changes: 0 additions & 6 deletions cmake/bgfx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ if(BGFX_CONFIG_RENDERER_WEBGPU)
endif()
endif()

# Enable BGFX_CONFIG_DEBUG in Debug configuration
target_compile_definitions( bgfx PRIVATE "$<$<CONFIG:Debug>:BGFX_CONFIG_DEBUG=1>" )
if(BGFX_CONFIG_DEBUG)
target_compile_definitions( bgfx PRIVATE BGFX_CONFIG_DEBUG=1)
endif()

if( NOT ${BGFX_OPENGL_VERSION} STREQUAL "" )
target_compile_definitions( bgfx PRIVATE BGFX_CONFIG_RENDERER_OPENGL_MIN_VERSION=${BGFX_OPENGL_VERSION} )
endif()
Expand Down
7 changes: 4 additions & 3 deletions cmake/bx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ target_compile_definitions( bx PUBLIC "__STDC_LIMIT_MACROS" )
target_compile_definitions( bx PUBLIC "__STDC_FORMAT_MACROS" )
target_compile_definitions( bx PUBLIC "__STDC_CONSTANT_MACROS" )

target_compile_definitions( bx PRIVATE "$<$<CONFIG:Debug>:BX_CONFIG_DEBUG=1>" )
if(BGFX_CONFIG_DEBUG)
target_compile_definitions( bx PRIVATE BX_CONFIG_DEBUG=1)
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
target_compile_definitions( bx PUBLIC "BX_CONFIG_DEBUG=1" )
else()
target_compile_definitions( bx PUBLIC "BX_CONFIG_DEBUG=0" )
endif()

# Additional dependencies on Unix
Expand Down

0 comments on commit d3260f1

Please sign in to comment.