From 14f1a30e389a42ae11480ab4278b19d01e63f9ab Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Thu, 21 Nov 2019 10:41:34 +0100 Subject: [PATCH] build system: move -fno-rtti link option next to the compile option Previous commit has added `link_options` to the root CMakeLists.txt, can use it to collect such global link options now. --- CMakeLists.txt | 1 + components/cxx/CMakeLists.txt | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e47cf5f81..f87020b52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,7 @@ if(CONFIG_COMPILER_CXX_RTTI) list(APPEND cxx_compile_options "-frtti") else() list(APPEND cxx_compile_options "-fno-rtti") + list(APPEND link_options "-fno-rtti") # used to invoke correct multilib variant (no-rtti) during linking endif() if(CONFIG_COMPILER_DISABLE_GCC8_WARNINGS) diff --git a/components/cxx/CMakeLists.txt b/components/cxx/CMakeLists.txt index 852c4c884..ff2d0e438 100644 --- a/components/cxx/CMakeLists.txt +++ b/components/cxx/CMakeLists.txt @@ -15,7 +15,3 @@ target_link_libraries(${COMPONENT_LIB} PUBLIC stdcpp_pthread) if(NOT CONFIG_COMPILER_CXX_EXCEPTIONS) target_link_libraries(${COMPONENT_LIB} INTERFACE "-u __cxx_fatal_exception") endif() - -if(NOT CONFIG_COMPILER_CXX_RTTI) - target_link_libraries(${COMPONENT_LIB} PUBLIC -fno-rtti) -endif()