From 12b75cc0ad0078a700d4854db16e119ef4706347 Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Tue, 2 Aug 2022 18:13:32 -0400 Subject: [PATCH] config: Add option to turn on debug output on release --- CMakeLists.txt | 1 + cmake/bgfx.cmake | 2 +- cmake/bx.cmake | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98a0a5a..e9716fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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" ) diff --git a/cmake/bgfx.cmake b/cmake/bgfx.cmake index 5c0ccdc..ef77df7 100755 --- a/cmake/bgfx.cmake +++ b/cmake/bgfx.cmake @@ -72,7 +72,7 @@ endif() # Add debug config required in bx headers since bx is private target_compile_definitions(bgfx PUBLIC - "BX_CONFIG_DEBUG=$" + "BX_CONFIG_DEBUG=$,1,$>" "BGFX_CONFIG_MULTITHREADED=$" ) diff --git a/cmake/bx.cmake b/cmake/bx.cmake index a784cde..3c30a34 100644 --- a/cmake/bx.cmake +++ b/cmake/bx.cmake @@ -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=$") +target_compile_definitions(bx PUBLIC "BX_CONFIG_DEBUG=$,1,$>") # Additional dependencies on Unix if (ANDROID)