Skip to content

Commit

Permalink
config: Add option to turn on debug output on release
Browse files Browse the repository at this point in the history
  • Loading branch information
bwrsandman committed Aug 7, 2022
1 parent 65dde38 commit 12b75cc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ option( BGFX_AMALGAMATED "Amalgamated bgfx build for faster compi
option( BX_AMALGAMATED "Amalgamated bx build for faster compilation" OFF )
option( BGFX_CONFIG_MULTITHREADED "Build bgfx with multithreaded configuration" ON )
option( BGFX_CONFIG_RENDERER_WEBGPU "Enables the webgpu renderer" OFF )
option( BX_CONFIG_DEBUG "Log debug messages (default: on in debug)" OFF )

set( BGFX_OPENGL_VERSION "" CACHE STRING "Specify minimum opengl version" )
set( BGFX_OPENGLES_VERSION "" CACHE STRING "Specify minimum OpenGL ES version" )
Expand Down
2 changes: 1 addition & 1 deletion cmake/bgfx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ endif()
# Add debug config required in bx headers since bx is private
target_compile_definitions(bgfx
PUBLIC
"BX_CONFIG_DEBUG=$<CONFIG:Debug>"
"BX_CONFIG_DEBUG=$<IF:$<CONFIG:Debug>,1,$<BOOL:${BX_CONFIG_DEBUG}>>"
"BGFX_CONFIG_MULTITHREADED=$<BOOL:${BGFX_CONFIG_MULTITHREADED}>"
)

Expand Down
2 changes: 1 addition & 1 deletion cmake/bx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ 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 PUBLIC "BX_CONFIG_DEBUG=$<CONFIG:Debug>")
target_compile_definitions(bx PUBLIC "BX_CONFIG_DEBUG=$<IF:$<CONFIG:Debug>,1,$<BOOL:${BX_CONFIG_DEBUG}>>")

# Additional dependencies on Unix
if (ANDROID)
Expand Down

0 comments on commit 12b75cc

Please sign in to comment.