[compiler-rt] 482fa79 - [NFC][CMake] Inline the append_libcxx_libs macro
Petr Hosek via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 28 23:52:47 PDT 2022
Author: Petr Hosek
Date: 2022-09-29T06:51:43Z
New Revision: 482fa79abb1b773a4b153f671de434f8abd67bc8
URL: https://github.com/llvm/llvm-project/commit/482fa79abb1b773a4b153f671de434f8abd67bc8
DIFF: https://github.com/llvm/llvm-project/commit/482fa79abb1b773a4b153f671de434f8abd67bc8.diff
LOG: [NFC][CMake] Inline the append_libcxx_libs macro
This is only invoked from a single site and doesn't add any value.
Added:
Modified:
compiler-rt/CMakeLists.txt
Removed:
################################################################################
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index ac737720eb68..8380b19ac22b 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++")
More information about the llvm-commits
mailing list