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>
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>)