summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorKefu Chai <tchaikov@gmail.com>2024-03-17 14:36:23 +0100
committerKefu Chai <tchaikov@gmail.com>2024-03-27 00:35:28 +0100
commit0dc61a4be335073e9a3047cf52ec3d12e4244f4d (patch)
treee2929993ed2fa7532cdc7cbd42c5e976e155ef71 /src/CMakeLists.txt
parentcmake: error out on UBSan error (diff)
downloadceph-0dc61a4be335073e9a3047cf52ec3d12e4244f4d.tar.xz
ceph-0dc61a4be335073e9a3047cf52ec3d12e4244f4d.zip
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 <tchaikov@gmail.com>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 90c9c48e06e..149bdc45562 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($<$<COMPILE_LANGUAGE:CXX>:-Wno-inconsistent-missing-override>)