From 2bc9e1d152062d155168b86f57be426f16161cc7 Mon Sep 17 00:00:00 2001 From: Thibault Lescoat Date: Tue, 7 Mar 2017 16:11:26 +0100 Subject: [PATCH 1/3] Update bgfx & bx --- bgfx | 2 +- bx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bgfx b/bgfx index fd6ab49..b0e1344 160000 --- a/bgfx +++ b/bgfx @@ -1 +1 @@ -Subproject commit fd6ab494fffb78293d68d4d4a2a21fad1773e0c4 +Subproject commit b0e13445dbf7808238241c45006beed743e4a87e diff --git a/bx b/bx index 008c3bf..2b46499 160000 --- a/bx +++ b/bx @@ -1 +1 @@ -Subproject commit 008c3bf9223f891f60d54d05d387042ffc01c4b4 +Subproject commit 2b46499044c324b9cb430394859ef5573dcec495 From 41f0cc83fea88bf0b391a7a9888750359c40e12d Mon Sep 17 00:00:00 2001 From: Thibault Lescoat Date: Tue, 7 Mar 2017 17:12:23 +0100 Subject: [PATCH 2/3] Some fixes to linux compilation --- CMakeLists.txt | 1 + cmake/bx.cmake | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa164d0..b21bec5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ option( BGFX_BUILD_TOOLS "Build bgfx tools." ON ) option( BGFX_BUILD_EXAMPLES "Build bgfx examples." ON ) option( BGFX_INSTALL "Create installation target." ON ) option( BGFX_USE_OVR "Build with OVR support." OFF ) +option( BX_AMALGAMATED "Amalgamate bx source files for faster compilation" ON ) if( NOT BX_DIR ) set( BX_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bx" CACHE STRING "Location of bgfx." ) diff --git a/cmake/bx.cmake b/cmake/bx.cmake index e94d116..c4da0e2 100644 --- a/cmake/bx.cmake +++ b/cmake/bx.cmake @@ -15,7 +15,12 @@ if( NOT IS_DIRECTORY ${BX_DIR} ) endif() # Grab the bx source files -file( GLOB BX_SOURCES ${BX_DIR}/src/*.cpp ) +if(BX_AMALGAMATED) + set(BX_SOURCES ${BX_DIR}/src/amalgamated.cpp) +else() + file( GLOB BX_SOURCES ${BX_DIR}/src/*.cpp ) + list(REMOVE_ITEM ${BX_DIR}/src/amalgamated.cpp) +endif() # Create the bx target add_library( bx STATIC ${BX_SOURCES} ) @@ -42,10 +47,14 @@ target_compile_definitions( bx PUBLIC "__STDC_LIMIT_MACROS" ) target_compile_definitions( bx PUBLIC "__STDC_FORMAT_MACROS" ) target_compile_definitions( bx PUBLIC "__STDC_CONSTANT_MACROS" ) -# Threads +# Additional dependencies on Unix if( UNIX AND NOT APPLE ) + # Threads find_package( Threads ) target_link_libraries( bx ${CMAKE_THREAD_LIBS_INIT} dl ) + + # Real time (for clock_gettime) + target_link_libraries( bx rt ) endif() # Put in a "bgfx" folder in Visual Studio From 84aaf72bf68c36128e6bb47824d7aa3bca5866f0 Mon Sep 17 00:00:00 2001 From: Thibault Lescoat Date: Wed, 8 Mar 2017 19:24:16 +0100 Subject: [PATCH 3/3] Mark non-build items as header in case of unity build --- cmake/bx.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/bx.cmake b/cmake/bx.cmake index c4da0e2..faf1399 100644 --- a/cmake/bx.cmake +++ b/cmake/bx.cmake @@ -15,11 +15,15 @@ if( NOT IS_DIRECTORY ${BX_DIR} ) endif() # Grab the bx source files +file( GLOB BX_SOURCES ${BX_DIR}/src/*.cpp ) if(BX_AMALGAMATED) - set(BX_SOURCES ${BX_DIR}/src/amalgamated.cpp) + set(BX_NOBUILD ${BX_SOURCES}) + list(REMOVE_ITEM BX_NOBUILD ${BX_DIR}/src/amalgamated.cpp) + foreach(BX_SRC ${BX_NOBUILD}) + set_source_files_properties( ${BX_SRC} PROPERTIES HEADER_FILE_ONLY ON ) + endforeach() else() - file( GLOB BX_SOURCES ${BX_DIR}/src/*.cpp ) - list(REMOVE_ITEM ${BX_DIR}/src/amalgamated.cpp) + set_source_files_properties( ${BX_DIR}/src/amalgamated.cpp PROPERTIES HEADER_FILE_ONLY ON ) endif() # Create the bx target