From 0dc61a4be335073e9a3047cf52ec3d12e4244f4d Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 17 Mar 2024 21:36:23 +0800 Subject: [PATCH] cmake: do not override CMAKE_EXE_LINKER_FLAGS instead of overriding CMAKE_EXE_LINKER_FLAGS, let's append to it. so that the existing `CMAKE_EXE_LINKER_FLAGS` is not overriden. this should enable us to build with Clang and with sanitizer(s) enabled. Signed-off-by: Kefu Chai --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 90c9c48e06e12..149bdc45562f3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -143,7 +143,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang) if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12) # require >= clang-12 message(FATAL_ERROR "C++20 support requires a minimum Clang version of 12.") endif() - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_EXPORTS_C_FLAG}") + string(APPEND CMAKE_EXE_LINKER_FLAGS " ${CMAKE_EXE_EXPORTS_C_FLAG}") string(APPEND CMAKE_LINKER_FLAGS " -rdynamic -export-dynamic ${CMAKE_EXE_EXPORTS_C_FLAG}") string(PREPEND CMAKE_CXX_FLAGS_DEBUG "-g ") add_compile_options($<$:-Wno-inconsistent-missing-override>) -- 2.39.5