|
@@ -22,8 +22,8 @@ option(BUILD_SHARED_LIBS "Compile Jolt as a shared library" OFF)
|
|
# If you don't do this you may get an error: /usr/bin/ld: libJolt.a: error adding symbols: file format not recognized
|
|
# If you don't do this you may get an error: /usr/bin/ld: libJolt.a: error adding symbols: file format not recognized
|
|
option(INTERPROCEDURAL_OPTIMIZATION "Enable interprocedural optimizations" ON)
|
|
option(INTERPROCEDURAL_OPTIMIZATION "Enable interprocedural optimizations" ON)
|
|
|
|
|
|
-# When turning this on, in Debug and Release mode, the library will emit extra code to ensure that the 4th component of a 3-vector is kept the same as the 3rd component
|
|
|
|
-# and will enable floating point exceptions during simulation to detect divisions by zero.
|
|
|
|
|
|
+# When turning this on, in Debug and Release mode, the library will emit extra code to ensure that the 4th component of a 3-vector is kept the same as the 3rd component
|
|
|
|
+# and will enable floating point exceptions during simulation to detect divisions by zero.
|
|
# Note that this currently only works using MSVC. Clang turns Float2 into a SIMD vector sometimes causing floating point exceptions (the option is ignored).
|
|
# Note that this currently only works using MSVC. Clang turns Float2 into a SIMD vector sometimes causing floating point exceptions (the option is ignored).
|
|
option(FLOATING_POINT_EXCEPTIONS_ENABLED "Enable floating point exceptions" ON)
|
|
option(FLOATING_POINT_EXCEPTIONS_ENABLED "Enable floating point exceptions" ON)
|
|
|
|
|
|
@@ -60,7 +60,7 @@ endif()
|
|
if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") AND NOT MINGW)
|
|
if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") AND NOT MINGW)
|
|
# Fill in the path to the asan libraries
|
|
# Fill in the path to the asan libraries
|
|
set(CLANG_LIB_PATH "\"$(VSInstallDir)\\VC\\Tools\\Llvm\\x64\\lib\\clang\\${CMAKE_CXX_COMPILER_VERSION}\\lib\\windows\"")
|
|
set(CLANG_LIB_PATH "\"$(VSInstallDir)\\VC\\Tools\\Llvm\\x64\\lib\\clang\\${CMAKE_CXX_COMPILER_VERSION}\\lib\\windows\"")
|
|
-
|
|
|
|
|
|
+
|
|
# 64 bit architecture
|
|
# 64 bit architecture
|
|
set(CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE "x64")
|
|
set(CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE "x64")
|
|
|
|
|
|
@@ -71,7 +71,7 @@ if (("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR "${CMAKE_SYSTEM_NAME}" STREQUA
|
|
|
|
|
|
# Set general compiler flags
|
|
# Set general compiler flags
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus /Gm- /MP /nologo /diagnostics:classic /FC /fp:except- /Zc:inline")
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus /Gm- /MP /nologo /diagnostics:classic /FC /fp:except- /Zc:inline")
|
|
-
|
|
|
|
|
|
+
|
|
# Enable warnings
|
|
# Enable warnings
|
|
if (ENABLE_ALL_WARNINGS)
|
|
if (ENABLE_ALL_WARNINGS)
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall /WX")
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall /WX")
|
|
@@ -195,7 +195,7 @@ set(PHYSICS_REPO_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../)
|
|
include(${PHYSICS_REPO_ROOT}/Jolt/Jolt.cmake)
|
|
include(${PHYSICS_REPO_ROOT}/Jolt/Jolt.cmake)
|
|
if (XCODE)
|
|
if (XCODE)
|
|
# Ensure that we enable SSE4.2 for the x86_64 build, XCode builds multiple architectures
|
|
# Ensure that we enable SSE4.2 for the x86_64 build, XCode builds multiple architectures
|
|
- set_property(TARGET Jolt PROPERTY XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS[arch=x86_64] "$(inherited) -msse4.2 -mpopcnt")
|
|
|
|
|
|
+ set_property(TARGET Jolt PROPERTY XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS[arch=x86_64] "$(inherited) -msse4.2 -mpopcnt")
|
|
endif()
|
|
endif()
|
|
|
|
|
|
# Install Jolt library and includes
|
|
# Install Jolt library and includes
|
|
@@ -208,7 +208,7 @@ foreach(SRC_FILE ${JOLT_PHYSICS_SRC_FILES})
|
|
endif()
|
|
endif()
|
|
endforeach()
|
|
endforeach()
|
|
|
|
|
|
-# Check if we're the root CMakeLists.txt, if not we are included by another CMake file and we should disable everything except for the main library
|
|
|
|
|
|
+# Check if we're the root CMakeLists.txt, if not we are included by another CMake file and we should disable everything except for the main library
|
|
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
|
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
|
# Ability to turn ON/OFF individual applications
|
|
# Ability to turn ON/OFF individual applications
|
|
option(TARGET_UNIT_TESTS "Build Unit Tests" ON)
|
|
option(TARGET_UNIT_TESTS "Build Unit Tests" ON)
|
|
@@ -265,7 +265,7 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
|
target_link_options(PerformanceTest PUBLIC "/SUBSYSTEM:CONSOLE")
|
|
target_link_options(PerformanceTest PUBLIC "/SUBSYSTEM:CONSOLE")
|
|
endif()
|
|
endif()
|
|
set_property(TARGET PerformanceTest PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${PHYSICS_REPO_ROOT}")
|
|
set_property(TARGET PerformanceTest PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${PHYSICS_REPO_ROOT}")
|
|
-
|
|
|
|
|
|
+
|
|
# Copy the assets folder
|
|
# Copy the assets folder
|
|
add_custom_command(TARGET PerformanceTest PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${PHYSICS_REPO_ROOT}/Assets/ $<TARGET_FILE_DIR:PerformanceTest>/Assets/)
|
|
add_custom_command(TARGET PerformanceTest PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${PHYSICS_REPO_ROOT}/Assets/ $<TARGET_FILE_DIR:PerformanceTest>/Assets/)
|
|
endif()
|
|
endif()
|
|
@@ -283,4 +283,4 @@ if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
|
include(${PHYSICS_REPO_ROOT}/JoltViewer/JoltViewer.cmake)
|
|
include(${PHYSICS_REPO_ROOT}/JoltViewer/JoltViewer.cmake)
|
|
endif()
|
|
endif()
|
|
endif()
|
|
endif()
|
|
-endif()
|
|
|
|
|
|
+endif()
|