Skip to content

Commit d8c4f9f

Browse files
committed
1 parent d0a5c09 commit d8c4f9f

File tree

4 files changed

+12
-17
lines changed

4 files changed

+12
-17
lines changed

extern/rendering/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ install_manifest.txt
1313
generated/*
1414
!generated/*.in
1515
cmake_install.cmake
16+
.cache/

extern/rendering/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ option( BGFX_CUSTOM_TARGETS "Include convenience custom targets." ON
3030
option( BGFX_USE_OVR "Build with OVR support." OFF )
3131
option( BGFX_AMALGAMATED "Amalgamated bgfx build for faster compilation" OFF )
3232
option( BX_AMALGAMATED "Amalgamated bx build for faster compilation" OFF )
33-
option( BGFX_CONFIG_DEBUG "Enables debug configuration on all builds" OFF )
3433
option( BGFX_CONFIG_RENDERER_WEBGPU "Enables the webgpu renderer" OFF )
3534

3635
set( BGFX_OPENGL_VERSION "" CACHE STRING "Specify minimum opengl version" )

extern/rendering/cmake/bgfx.cmake

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@ if(BGFX_CONFIG_RENDERER_WEBGPU)
5252
endif()
5353
endif()
5454

55-
# Enable BGFX_CONFIG_DEBUG in Debug configuration
56-
target_compile_definitions( bgfx PRIVATE "$<$<CONFIG:Debug>:BGFX_CONFIG_DEBUG=1>" )
57-
if(BGFX_CONFIG_DEBUG)
58-
target_compile_definitions( bgfx PRIVATE BGFX_CONFIG_DEBUG=1)
59-
endif()
60-
6155
if( NOT ${BGFX_OPENGL_VERSION} STREQUAL "" )
6256
target_compile_definitions( bgfx PRIVATE BGFX_CONFIG_RENDERER_OPENGL_MIN_VERSION=${BGFX_OPENGL_VERSION} )
6357
endif()

extern/rendering/cmake/bx.cmake

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ target_include_directories( bx
4545
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> )
4646

4747
# Build system specific configurations
48-
if( MSVC OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
49-
target_include_directories( bx
50-
PUBLIC
51-
$<BUILD_INTERFACE:${BX_DIR}/include/compat/msvc>
52-
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/compat/msvc> )
53-
elseif( MINGW )
48+
if( MINGW )
5449
target_include_directories( bx
5550
PUBLIC
5651
$<BUILD_INTERFACE:${BX_DIR}/include/compat/mingw>
5752
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/compat/mingw> )
53+
elseif( WIN32 )
54+
target_include_directories( bx
55+
PUBLIC
56+
$<BUILD_INTERFACE:${BX_DIR}/include/compat/msvc>
57+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/compat/msvc> )
5858
elseif( APPLE )
5959
target_include_directories( bx
6060
PUBLIC
@@ -67,9 +67,10 @@ target_compile_definitions( bx PUBLIC "__STDC_LIMIT_MACROS" )
6767
target_compile_definitions( bx PUBLIC "__STDC_FORMAT_MACROS" )
6868
target_compile_definitions( bx PUBLIC "__STDC_CONSTANT_MACROS" )
6969

70-
target_compile_definitions( bx PRIVATE "$<$<CONFIG:Debug>:BX_CONFIG_DEBUG=1>" )
71-
if(BGFX_CONFIG_DEBUG)
72-
target_compile_definitions( bx PRIVATE BX_CONFIG_DEBUG=1)
70+
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
71+
target_compile_definitions( bx PUBLIC "BX_CONFIG_DEBUG=1" )
72+
else()
73+
target_compile_definitions( bx PUBLIC "BX_CONFIG_DEBUG=0" )
7374
endif()
7475

7576
# Additional dependencies on Unix
@@ -87,4 +88,4 @@ elseif(APPLE)
8788
endif()
8889

8990
# Put in a "bgfx" folder in Visual Studio
90-
set_target_properties( bx PROPERTIES FOLDER "bgfx" )
91+
set_target_properties( bx PROPERTIES FOLDER "bgfx" )

0 commit comments

Comments
 (0)