mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-16 16:39:01 +08:00
4c826df5e5
[As suggested by Dd0yt](https://github.com/microsoft/vcpkg/pull/37997#discussion_r1554483645), this PR disable the OVERRIDE_CXX_FLAGS option instead of patching it. - [x] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [x] SHA512s are updated for each updated download. - [ ] ~~The "supports" clause reflects platforms that may be fixed by this new version.~~ - [ ] ~~Any fixed [CI baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt) entries are removed from that file.~~ - [ ] ~~Any patches that are no longer applied are deleted from the port's directory.~~ - [x] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [x] Only one version is added to each modified port's versions file.
63 lines
2.3 KiB
Diff
63 lines
2.3 KiB
Diff
diff --git a/Build/CMakeLists.txt b/Build/CMakeLists.txt
|
|
index 830453f..5c9f155 100644
|
|
--- a/Build/CMakeLists.txt
|
|
+++ b/Build/CMakeLists.txt
|
|
@@ -122,8 +122,8 @@ if (MSVC)
|
|
endif()
|
|
|
|
# Set compiler flags for various configurations
|
|
- set(CMAKE_CXX_FLAGS_DEBUG "/GS /Od /Ob0 /RTC1")
|
|
- set(CMAKE_CXX_FLAGS_RELEASE "/GS- /Gy /O2 /Oi /Ot")
|
|
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /GS /Od /Ob0 /RTC1")
|
|
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GS- /Gy /O2 /Oi /Ot")
|
|
set(CMAKE_CXX_FLAGS_DISTRIBUTION "/GS- /Gy /O2 /Oi /Ot")
|
|
set(CMAKE_CXX_FLAGS_RELEASEASAN "-fsanitize=address /Od")
|
|
set(CMAKE_CXX_FLAGS_RELEASEUBSAN "-fsanitize=undefined,implicit-conversion,float-divide-by-zero,local-bounds -fno-sanitize-recover=all")
|
|
@@ -232,7 +232,11 @@ if (XCODE)
|
|
endif()
|
|
|
|
# Install Jolt library and includes
|
|
-install(TARGETS Jolt DESTINATION lib)
|
|
+install(TARGETS Jolt
|
|
+ EXPORT unofficial-joltphysics-targets
|
|
+ ARCHIVE DESTINATION lib
|
|
+ LIBRARY DESTINATION lib
|
|
+ RUNTIME DESTINATION bin)
|
|
foreach(SRC_FILE ${JOLT_PHYSICS_SRC_FILES})
|
|
string(REPLACE ${PHYSICS_REPO_ROOT} "" RELATIVE_SRC_FILE ${SRC_FILE})
|
|
get_filename_component(DESTINATION_PATH ${RELATIVE_SRC_FILE} DIRECTORY)
|
|
@@ -241,6 +245,17 @@ foreach(SRC_FILE ${JOLT_PHYSICS_SRC_FILES})
|
|
endif()
|
|
endforeach()
|
|
|
|
+install(EXPORT unofficial-joltphysics-targets
|
|
+ NAMESPACE unofficial::joltphysics::
|
|
+ FILE unofficial-joltphysics-targets.cmake
|
|
+ DESTINATION share/unofficial-joltphysics
|
|
+)
|
|
+
|
|
+install(FILES
|
|
+ unofficial-joltphysics-config.cmake
|
|
+ DESTINATION share/unofficial-joltphysics
|
|
+)
|
|
+
|
|
# 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)
|
|
# Ability to turn ON/OFF individual applications
|
|
diff --git a/Jolt/Jolt.cmake b/Jolt/Jolt.cmake
|
|
index 2b28284..43912a5 100644
|
|
--- a/Jolt/Jolt.cmake
|
|
+++ b/Jolt/Jolt.cmake
|
|
@@ -487,7 +487,10 @@ if (BUILD_SHARED_LIBS)
|
|
target_compile_definitions(Jolt PRIVATE JPH_BUILD_SHARED_LIBRARY)
|
|
endif()
|
|
|
|
-target_include_directories(Jolt PUBLIC ${PHYSICS_REPO_ROOT})
|
|
+target_include_directories(Jolt PUBLIC
|
|
+ $<BUILD_INTERFACE:${PHYSICS_REPO_ROOT}>
|
|
+ $<INSTALL_INTERFACE:include>
|
|
+)
|
|
target_precompile_headers(Jolt PRIVATE ${JOLT_PHYSICS_ROOT}/Jolt.h)
|
|
|
|
# Set the debug/non-debug build flags
|