From 482fa79abb1b773a4b153f671de434f8abd67bc8 Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Thu, 29 Sep 2022 06:51:43 +0000 Subject: [PATCH] [NFC][CMake] Inline the append_libcxx_libs macro This is only invoked from a single site and doesn't add any value. --- compiler-rt/CMakeLists.txt | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index ac73772..8380b19 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -573,31 +573,27 @@ else() # Nothing to be done for `default`. endif() -macro(append_libcxx_libs var) - if (${var}_INTREE) +if (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libc++") + if (SANITIZER_CXX_ABI_INTREE) # TODO: We don't need to add --unwindlib=none to SANITIZER_COMMON_LINK_FLAGS # because we added -nodefaultlibs there earlier, and adding would result in # a warning, but if we switch to -nostdlib++, we would need to add it here. # append_list_if(CXX_SUPPORTS_UNWINDLIB_NONE_FLAG --unwindlib=none SANITIZER_COMMON_LINK_FLAGS) if (SANITIZER_USE_STATIC_LLVM_UNWINDER AND (TARGET unwind_static OR HAVE_LIBUNWIND)) - list(APPEND ${var}_LIBRARIES unwind_static) + list(APPEND SANITIZER_CXX_ABI_LIBRARIES unwind_static) elseif (TARGET unwind_shared OR HAVE_LIBUNWIND) - list(APPEND ${var}_LIBRARIES unwind_shared) + list(APPEND SANITIZER_CXX_ABI_LIBRARIES unwind_shared) endif() if (SANITIZER_USE_STATIC_CXX_ABI AND (TARGET cxxabi_static OR HAVE_LIBCXXABI)) - list(APPEND ${var}_LIBRARIES cxxabi_static) + list(APPEND SANITIZER_CXX_ABI_LIBRARIES cxxabi_static) elseif (TARGET cxxabi_shared OR HAVE_LIBCXXABI) - list(APPEND ${var}_LIBRARIES cxxabi_shared) + list(APPEND SANITIZER_CXX_ABI_LIBRARIES cxxabi_shared) endif() else() - append_list_if(COMPILER_RT_HAS_LIBCXX c++ ${var}_LIBRARIES) + append_list_if(COMPILER_RT_HAS_LIBCXX c++ SANITIZER_CXX_ABI_LIBRARIES) endif() -endmacro() - -if (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libc++") - append_libcxx_libs(SANITIZER_CXX_ABI) elseif (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libcxxabi") list(APPEND SANITIZER_CXX_ABI_LIBRARIES "c++abi") elseif (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libstdc++") -- 2.7.4