mirror of
https://github.com/bkaradzic/bgfx.cmake.git
synced 2026-02-17 21:12:35 +01:00
Fixed: Debug/CHECK builds of bgfx were not straightforward with the current setup; bgfx relies on BX also being debug-enabled, while this only enabled it for BGFX and only in CMAKE Debug mode. Added BGFX_CONFIG_DEBUG cmake option to easily enable checked/trace builds in release mode
This commit is contained in:
committed by
Joshua Brookover
parent
9972c1001b
commit
43c8db3c9f
@@ -27,6 +27,7 @@ option( BGFX_CUSTOM_TARGETS "Include convenience custom targets." ON
|
||||
option( BGFX_USE_OVR "Build with OVR support." OFF )
|
||||
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)
|
||||
|
||||
if( NOT BX_DIR )
|
||||
set( BX_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bx" CACHE STRING "Location of bx." )
|
||||
|
||||
@@ -35,6 +35,9 @@ add_library( bgfx STATIC ${BGFX_SOURCES} )
|
||||
|
||||
# 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()
|
||||
|
||||
# Special Visual Studio Flags
|
||||
if( MSVC )
|
||||
|
||||
@@ -16,6 +16,7 @@ endif()
|
||||
|
||||
# Grab the bx source files
|
||||
file( GLOB BX_SOURCES ${BX_DIR}/src/*.cpp )
|
||||
|
||||
if(BX_AMALGAMATED)
|
||||
set(BX_NOBUILD ${BX_SOURCES})
|
||||
list(REMOVE_ITEM BX_NOBUILD ${BX_DIR}/src/amalgamated.cpp)
|
||||
@@ -51,6 +52,11 @@ 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)
|
||||
endif()
|
||||
|
||||
# Additional dependencies on Unix
|
||||
if( UNIX AND NOT APPLE )
|
||||
# Threads
|
||||
|
||||
Reference in New Issue
Block a user