ci: Use link-time optimization for building (#1636)

* ci: Use link-time optimization for building

* cmake: Set CMP0069 policy to new for external dependencies
* This enables LTO also when building external dependencies that do not
  handle CMP0069 in their CMake scripts.
This commit is contained in:
MajorP93 2024-12-13 17:30:16 +01:00 committed by GitHub
parent cfbd869126
commit 306279901f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 6 deletions

View file

@ -8,6 +8,9 @@ set_directory_properties(PROPERTIES
SYSTEM ON
)
# Set CMP0069 policy to "NEW" in order to ensure consistent behavior when building external targets with LTO enabled
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
if (MSVC)
# Silence "deprecation" warnings
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS)