[libcxx-commits] [PATCH] D119539: [libcxx] [cmake] Fix linking to installed libc++abi in runtimes build

Michał Górny via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Feb 11 04:00:01 PST 2022


mgorny created this revision.
mgorny added a reviewer: ldionne.
mgorny requested review of this revision.

When building libc++ via runtimes with LLVM_ENABLE_RUNTIMES=libcxx,
the build fails trying to link with cxxabi_shared and/or cxxabi_static.
However, these targets exist only when building libcxxabi as well.
Replace the old rules accounting for standalone builds with a simpler
one based on whether the respective targets exist.


https://reviews.llvm.org/D119539

Files:
  libcxx/cmake/Modules/HandleLibCXXABI.cmake


Index: libcxx/cmake/Modules/HandleLibCXXABI.cmake
===================================================================
--- libcxx/cmake/Modules/HandleLibCXXABI.cmake
+++ libcxx/cmake/Modules/HandleLibCXXABI.cmake
@@ -107,12 +107,12 @@
     set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_SOURCE_DIR}/../libcxxabi/include")
   endif()
 
-  if(LIBCXX_STANDALONE_BUILD AND NOT (LIBCXX_CXX_ABI_INTREE OR HAVE_LIBCXXABI))
-    set(shared c++abi)
-    set(static c++abi)
-  else()
+  if(TARGET cxxabi_shared OR TARGET cxxabi_static)
     set(shared cxxabi_shared)
     set(static cxxabi_static)
+  else()
+    set(shared c++abi)
+    set(static c++abi)
   endif()
 
   setup_abi_lib(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119539.407835.patch
Type: text/x-patch
Size: 672 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220211/9d891828/attachment.bin>


More information about the libcxx-commits mailing list