34 lines
No EOL
873 B
CMake
34 lines
No EOL
873 B
CMake
# Shared code for samples, benchmarks, and unit tests
|
|
|
|
set(BOX3D_SHARED_FILES
|
|
benchmarks.c
|
|
benchmarks.h
|
|
determinism.c
|
|
determinism.h
|
|
human.c
|
|
human.h
|
|
overflow_color.c
|
|
overflow_color.h
|
|
stability.c
|
|
stability.h
|
|
utils.c
|
|
utils.h
|
|
)
|
|
|
|
add_library(shared STATIC ${BOX3D_SHARED_FILES})
|
|
|
|
set_target_properties(shared PROPERTIES
|
|
C_STANDARD 17
|
|
)
|
|
|
|
target_include_directories(shared PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
target_link_libraries(shared PRIVATE box3d)
|
|
|
|
# The SAT benchmark calls internal functions that a shared Box3D does not export
|
|
if (NOT BUILD_SHARED_LIBS)
|
|
target_sources(shared PRIVATE sat_benchmark.c sat_benchmark.h)
|
|
target_include_directories(shared PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../src)
|
|
target_compile_definitions(shared PUBLIC BOX3D_INTERNAL_BENCHMARKS)
|
|
endif()
|
|
|
|
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX "" FILES ${BOX3D_SHARED_FILES}) |