[libcxx] r214114 - Fix linking with just-built libc++abi (added in r214037).

Alexey Samsonov vonosmas at gmail.com
Mon Jul 28 12:25:44 PDT 2014


Author: samsonov
Date: Mon Jul 28 14:25:44 2014
New Revision: 214114

URL: http://llvm.org/viewvc/llvm-project?rev=214114&view=rev
Log:
Fix linking with just-built libc++abi (added in r214037).

Pass target name ("cxxabi") to target_link_libraries(cxx ...) to ensure
that linker is able to locate just-built libc++abi in the build tree,
instead of relying on "-lc++abi" linker flag.

Modified:
    libcxx/trunk/CMakeLists.txt

Modified: libcxx/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=214114&r1=214113&r2=214114&view=diff
==============================================================================
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Mon Jul 28 14:25:44 2014
@@ -152,13 +152,16 @@ if ("${LIBCXX_CXX_ABI}" STREQUAL "libstd
     "${_LIBSUPCXX_LIBNAME}" "${_LIBSUPCXX_INCLUDE_FILES}" "bits"
     )
 elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxabi")
+  if (LIBCXX_CXX_ABI_INTREE)
+    # Link against just-built "cxxabi" target.
+    set(CXXABI_LIBNAME cxxabi)
+  else()
+    # Assume c++abi is installed in the system, rely on -lc++abi link flag.
+    set(CXXABI_LIBNAME "c++abi")
+  endif()
   setup_abi_lib("LIBCXX_LIBCXXABI_INCLUDE_PATHS" ""
-    "c++abi" "cxxabi.h" ""
+    ${CXXABI_LIBNAME} "cxxabi.h" ""
     )
-
-  if (LIBCXX_CXX_ABI_INTREE)
-    add_dependencies(LIBCXX_CXX_ABI_DEPS cxxabi)
-  endif ()
 elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxrt")
   setup_abi_lib("LIBCXX_LIBCXXRT_INCLUDE_PATHS" "-DLIBCXXRT"
     "cxxrt" "cxxabi.h;unwind.h;unwind-arm.h;unwind-itanium.h" ""





More information about the cfe-commits mailing list