Update CMakeLists.txt

This commit is contained in:
alexey-milovidov 2020-05-01 18:41:53 +03:00 committed by GitHub
parent f11148a77c
commit ab42691b77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -226,7 +226,7 @@ if (COMPILER_CLANG)
# We cannot afford to use LTO when compiling unitests, and it's not enough
# to only supply -fno-lto at the final linking stage. So we disable it
# completely.
if (NOT ENABLE_TESTS)
if (NOT ENABLE_TESTS AND NOT SANITIZE)
# Link time optimization
set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -flto=thin")
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -flto=thin")