[compiler-rt] r329205 - [CMake] Support statically linked libc++abi and libunwind

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 4 09:27:34 PDT 2018


Author: phosek
Date: Wed Apr  4 09:27:33 2018
New Revision: 329205

URL: http://llvm.org/viewvc/llvm-project?rev=329205&view=rev
Log:
[CMake] Support statically linked libc++abi and libunwind

This expands the CMake check to handle both statically and dynamically
linked version of libc++abi and libunwind and matches the implemnetation
used elsewhere in LLVM.

Differential Revision: https://reviews.llvm.org/D45242

Modified:
    compiler-rt/trunk/CMakeLists.txt

Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=329205&r1=329204&r2=329205&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Wed Apr  4 09:27:33 2018
@@ -152,11 +152,15 @@ endif()
 
 if (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libcxxabi")
   if (SANITIZER_CXX_ABI_INTREE)
-    if (TARGET unwind_shared OR HAVE_LIBUNWIND)
+    if (NOT LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_shared OR HAVE_LIBUNWIND))
       list(APPEND SANITIZER_CXX_ABI_LIBRARY unwind_shared)
+    elseif (LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_static OR HAVE_LIBUNWIND))
+      list(APPEND SANITIZER_CXX_ABI_LIBRARY unwind_static)
     endif()
-    if (TARGET cxxabi_shared OR HAVE_LIBCXXABI)
+    if (NOT LIBCXX_ENABLE_STATIC_ABI_LIBRARY AND (TARGET cxxabi_shared OR HAVE_LIBCXXABI))
       list(APPEND SANITIZER_CXX_ABI_LIBRARY cxxabi_shared)
+    elseif (LIBCXX_ENABLE_STATIC_ABI_LIBRARY AND (TARGET cxxabi_static OR HAVE_LIBCXXABI))
+      list(APPEND SANITIZER_CXX_ABI_LIBRARY cxxabi_static)
     endif()
   else()
     list(APPEND SANITIZER_CXX_ABI_LIBRARY "c++abi")




More information about the llvm-commits mailing list