|
@@ -314,15 +314,26 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
|
|
add_executable(UnitTests ${UNIT_TESTS_SRC_FILES})
|
|
|
target_include_directories(UnitTests PUBLIC ${UNIT_TESTS_ROOT})
|
|
|
target_link_libraries(UnitTests LINK_PUBLIC Jolt)
|
|
|
- target_precompile_headers(UnitTests PRIVATE "$<$<NOT:$<CONFIG:ReleaseCoverage>>:${JOLT_PHYSICS_ROOT}/Jolt.h>") # Code coverage doesn't work when using precompiled headers
|
|
|
+
|
|
|
+ # Code coverage doesn't work when using precompiled headers
|
|
|
+ if (CMAKE_GENERATOR STREQUAL "Ninja Multi-Config" AND MSVC)
|
|
|
+ # The Ninja Multi-Config generator errors out when selectively disabling precompiled headers for certain configurations.
|
|
|
+ # See: https://github.com/jrouwe/JoltPhysics/issues/1211
|
|
|
+ target_precompile_headers(UnitTests PRIVATE "${JOLT_PHYSICS_ROOT}/Jolt.h")
|
|
|
+ else()
|
|
|
+ target_precompile_headers(UnitTests PRIVATE "$<$<NOT:$<CONFIG:ReleaseCoverage>>:${JOLT_PHYSICS_ROOT}/Jolt.h>")
|
|
|
+ endif()
|
|
|
+
|
|
|
if (MSVC)
|
|
|
target_link_options(UnitTests PUBLIC "/SUBSYSTEM:CONSOLE")
|
|
|
endif()
|
|
|
+
|
|
|
if (IOS)
|
|
|
# Set the bundle information
|
|
|
set_property(TARGET UnitTests PROPERTY MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/iOS/UnitTestsInfo.plist")
|
|
|
set_property(TARGET UnitTests PROPERTY XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.joltphysics.unittests")
|
|
|
endif()
|
|
|
+
|
|
|
if (XCODE)
|
|
|
# Ensure that we enable SSE4.2 for the x86_64 build, XCode builds multiple architectures
|
|
|
set_property(TARGET UnitTests PROPERTY XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS[arch=x86_64] "$(inherited) -msse4.2 -mpopcnt")
|