Disable ThinLTO for clang-tidy builds

This commit is contained in:
Robert Schulze 2024-12-17 21:36:05 +00:00
parent 11c86ed884
commit 0318a40a25
No known key found for this signature in database
GPG Key ID: 26703B55FB13728A

View File

@ -347,10 +347,11 @@ endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-absolute-paths")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-absolute-paths")
if (NOT ENABLE_TESTS AND NOT SANITIZE AND NOT SANITIZE_COVERAGE AND OS_LINUX)
if (NOT ENABLE_TESTS AND NOT ENABLE_CLANG_TIDY AND NOT SANITIZE AND NOT SANITIZE_COVERAGE AND OS_LINUX)
# https://clang.llvm.org/docs/ThinLTO.html
# Applies to clang and linux only.
# Disabled when building with tests or sanitizers.
# Also disabled with clang-tidy where we don't care about linking
option(ENABLE_THINLTO "Clang-specific link time optimization" ON)
endif()