Skip to content

Commit

Permalink
Trim SIMDE and more cmake cleanup (#90)
Browse files Browse the repository at this point in the history
Could not remove float16 stuff without major modification
  • Loading branch information
erincatto authored Dec 28, 2023
1 parent 07e351d commit 8c53574
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 153 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
FetchContent_MakeAvailable(enkits)

# Tests need static linkage because they test internal Box2D functions
if (NOT ${BUILD_SHARED_LIBS})
if (NOT BUILD_SHARED_LIBS)
message(STATUS "Adding Box2D unit tests")
add_subdirectory(test)
else()
Expand Down
1 change: 0 additions & 1 deletion extern/simde/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ add_library(
simde-aes.h
simde-align.h
simde-arch.h
simde-bf16.h
simde-common.h
simde-complex.h
simde-constify.h
Expand Down
131 changes: 0 additions & 131 deletions extern/simde/simde-bf16.h

This file was deleted.

7 changes: 2 additions & 5 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,14 @@ set(JSMN_DIR ${CMAKE_SOURCE_DIR}/extern/jsmn)
add_library(jsmn INTERFACE ${JSMN_DIR}/jsmn.h)
target_include_directories(jsmn INTERFACE ${JSMN_DIR})

set(BOX2D_SAMPLES
add_executable(samples
draw.cpp
draw.h
main.cpp
sample.cpp
sample.h
settings.h
settings.cpp

collection/benchmark.cpp
collection/human.cpp
collection/human.h
Expand All @@ -85,8 +84,6 @@ set(BOX2D_SAMPLES
collection/sample_vertical_stack.cpp
)

add_executable(samples ${BOX2D_SAMPLES})

set_target_properties(samples PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
Expand All @@ -107,4 +104,4 @@ add_custom_command(
${CMAKE_CURRENT_SOURCE_DIR}/data/
${CMAKE_CURRENT_BINARY_DIR}/data/)

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${BOX2D_SAMPLES})
# source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${BOX2D_SAMPLES})
16 changes: 4 additions & 12 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,7 @@ set(BOX2D_API_FILES
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)

if (MSVC)
# Visual Studio won't load the natvis unless it is in the project
add_library(box2d ${BOX2D_SOURCE_FILES} ${BOX2D_API_FILES} box2d.natvis)
else()
add_library(box2d ${BOX2D_SOURCE_FILES} ${BOX2D_API_FILES})
endif()
add_library(box2d ${BOX2D_SOURCE_FILES} ${BOX2D_API_FILES})

# Generate box2d_export.h to handles shared library builds
include(GenerateExportHeader)
Expand Down Expand Up @@ -118,6 +113,9 @@ set_target_properties(box2d PROPERTIES
)

if (MSVC)
# Visual Studio won't load the natvis unless it is in the project
target_sources(box2d PRIVATE box2d.natvis)

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# Atomics are still considered experimental in Visual Studio 17.8
target_compile_options(box2d PRIVATE /experimental:c11atomics /arch:AVX2)
Expand All @@ -138,12 +136,6 @@ elseif (APPLE)
# target_compile_options(box2d PRIVATE)
endif()

# todo needed?
find_library(MATH_LIBRARY m)
if (MATH_LIBRARY)
target_link_libraries(box2d PUBLIC ${MATH_LIBRARY})
endif()

if (BOX2D_PROFILE)
target_compile_definitions(box2d PRIVATE BOX2D_PROFILE)

Expand Down
4 changes: 1 addition & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Box2D unit test app

set(BOX2D_TESTS
add_executable(test
main.c
test_bitset.c
test_collision.c
Expand All @@ -13,8 +13,6 @@ set(BOX2D_TESTS
test_world.c
)

add_executable(test ${BOX2D_TESTS})

set_target_properties(test PROPERTIES
C_STANDARD 17
C_STANDARD_REQUIRED YES
Expand Down

0 comments on commit 8c53574

Please sign in to comment.