From 0f1a5a91e6f59862b2bcf1d983829037b7d59028 Mon Sep 17 00:00:00 2001 From: Ravbug Date: Sun, 19 Dec 2021 11:44:52 -0800 Subject: [PATCH] Change BGFX_CONFIG_DEBUG to generator expression --- cmake/bgfx.cmake | 7 +------ cmake/bx.cmake | 6 +----- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/cmake/bgfx.cmake b/cmake/bgfx.cmake index adc05e4..3342249 100755 --- a/cmake/bgfx.cmake +++ b/cmake/bgfx.cmake @@ -66,12 +66,7 @@ if( MSVC ) endif() # Add debug config required in bx headers since bx is private -if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") - target_compile_definitions( bgfx PUBLIC "BX_CONFIG_DEBUG=1" ) -else() - target_compile_definitions( bgfx PUBLIC "BX_CONFIG_DEBUG=0" ) -endif() - +target_compile_definitions(bgfx PUBLIC $<$:BX_CONFIG_DEBUG=1> $<$:BX_CONFIG_DEBUG=0>) # Includes target_include_directories( bgfx diff --git a/cmake/bx.cmake b/cmake/bx.cmake index 2b34301..1c6196d 100644 --- a/cmake/bx.cmake +++ b/cmake/bx.cmake @@ -67,11 +67,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" ) -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() +target_compile_definitions(bx PUBLIC $<$:BX_CONFIG_DEBUG=1> $<$:BX_CONFIG_DEBUG=0>) # Additional dependencies on Unix if( UNIX AND NOT APPLE AND NOT ANDROID )