]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: do not override CMAKE_EXE_LINKER_FLAGS
authorKefu Chai <tchaikov@gmail.com>
Sun, 17 Mar 2024 13:36:23 +0000 (21:36 +0800)
committerKefu Chai <tchaikov@gmail.com>
Tue, 26 Mar 2024 23:35:28 +0000 (07:35 +0800)
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>
src/CMakeLists.txt

index 90c9c48e06e125a7e802fed5a8aafe1bd87930bb..149bdc45562f389114549ba8b5321a59260130d1 100644 (file)
@@ -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>)