mirror of
https://github.com/bkaradzic/bgfx.cmake.git
synced 2026-02-17 21:12:35 +01:00
@@ -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
2
bgfx
Submodule bgfx updated: fd6ab494ff...b0e13445db
2
bx
2
bx
Submodule bx updated: 008c3bf922...2b46499044
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user