[libcxx] r220121 - Add special case for finding the in-tree ABI library.

Eric Fiselier eric at efcs.ca
Fri Oct 17 19:19:28 PDT 2014


Author: ericwf
Date: Fri Oct 17 21:19:28 2014
New Revision: 220121

URL: http://llvm.org/viewvc/llvm-project?rev=220121&view=rev
Log:
Add special case for finding the in-tree ABI library.

When libcxx is built in-tree with libcxxabi it links against libcxxabi using
the name of the cmake target and not the actual library name. The cmake target
will not work with `find_library()`, so it needs special case handling.

Modified:
    libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake

Modified: libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake?rev=220121&r1=220120&r2=220121&view=diff
==============================================================================
--- libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake (original)
+++ libcxx/trunk/cmake/Modules/HandleLibCXXABI.cmake Fri Oct 17 21:19:28 2014
@@ -27,13 +27,20 @@ macro(setup_abi_lib abipathvar abidefine
   # each run of find_library.
   set(LIBCXX_CXX_ABI_LIBRARIES "")
   foreach(alib ${abilibs})
-    unset(_Res CACHE)
-    find_library(_Res ${alib})
-    if (${_Res} STREQUAL "_Res-NOTFOUND")
-      message(FATAL_ERROR "Failed to find ABI library: ${alib}")
+    # cxxabi is a cmake target and not a library.
+    # Handle this special case explicitly.
+    # Otherwise use find_library to locate the correct binary.
+    if (alib STREQUAL "cxxabi")
+      list(APPEND LIBCXX_CXX_ABI_LIBRARIES cxxabi)
     else()
-      message(STATUS "Adding ABI library: ${_Res}")
-      list(APPEND LIBCXX_CXX_ABI_LIBRARIES ${_Res})
+      unset(_Res CACHE)
+      find_library(_Res ${alib})
+      if (${_Res} STREQUAL "_Res-NOTFOUND")
+        message(FATAL_ERROR "Failed to find ABI library: ${alib}")
+      else()
+        message(STATUS "Adding ABI library: ${_Res}")
+        list(APPEND LIBCXX_CXX_ABI_LIBRARIES ${_Res})
+      endif()
     endif()
   endforeach()
 





More information about the cfe-commits mailing list