Merge pull request #5 from Synxis/master

Update bgfx & bx
This commit is contained in:
Joshua Brookover
2017-03-08 19:21:18 -06:00
committed by GitHub
4 changed files with 17 additions and 3 deletions

View File

@@ -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." )

2
bgfx

Submodule bgfx updated: fd6ab494ff...b0e13445db

2
bx

Submodule bx updated: 008c3bf922...2b46499044

View File

@@ -16,6 +16,15 @@ 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)
foreach(BX_SRC ${BX_NOBUILD})
set_source_files_properties( ${BX_SRC} PROPERTIES HEADER_FILE_ONLY ON )
endforeach()
else()
set_source_files_properties( ${BX_DIR}/src/amalgamated.cpp PROPERTIES HEADER_FILE_ONLY ON )
endif()
# Create the bx target
add_library( bx STATIC ${BX_SOURCES} )
@@ -42,10 +51,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