[PATCH] D26362: [CMake] Check runtimes subdir when looking for libcxx and libuwind

Petr Hosek via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 8 20:43:38 PST 2016


phosek updated this revision to Diff 77308.
phosek added a comment.

The original version caused a build breakage because `LIBCXXABI_LIBCXX_SRC_DIR` was used both as a string and a list in different contexts. This is a reland of the same change which addresses that issue, please take a look.


Repository:
  rL LLVM

https://reviews.llvm.org/D26362

Files:
  CMakeLists.txt


Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -138,18 +138,26 @@
 endif()
 
 if (LLVM_EXTERNAL_LIBCXX_SOURCE_DIR)
-  set(LIBCXXABI_LIBCXX_SRC_DIR ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR})
+  set(LIBCXXABI_LIBCXX_SRC_DIRS ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR})
 else()
-  set(LIBCXXABI_LIBCXX_SRC_DIR ${LLVM_MAIN_SRC_DIR}/projects/libcxx)
+  set(LIBCXXABI_LIBCXX_SRC_DIRS
+    "${LLVM_MAIN_SRC_DIR}/projects/libcxx"
+    "${LLVM_MAIN_SRC_DIR}/runtimes/libcxx"
+    )
 endif()
 
+set(LIBCXXABI_LIBCXX_INCLUDE_DIRS "")
+foreach(dir ${LIBCXXABI_LIBCXX_SRC_DIRS})
+  list(APPEND LIBCXXABI_LIBCXX_INCLUDE_DIRS "${dir}/include")
+endforeach()
+
 find_path(
   LIBCXXABI_LIBCXX_INCLUDES
   vector
   PATHS ${LIBCXXABI_LIBCXX_INCLUDES}
         ${LIBCXXABI_LIBCXX_PATH}/include
         ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBCXX_INCLUDES}
-        ${LIBCXXABI_LIBCXX_SRC_DIR}/include
+        ${LIBCXXABI_LIBCXX_INCLUDE_DIRS}
         ${LLVM_INCLUDE_DIR}/c++/v1
   )
 
@@ -161,7 +169,7 @@
   test/libcxx/__init__.py
   PATHS ${LIBCXXABI_LIBCXX_PATH}
         ${LIBCXXABI_LIBCXX_INCLUDES}/../
-        ${LIBCXXABI_LIBCXX_SRC_DIR}
+        ${LIBCXXABI_LIBCXX_SRC_DIRS}
   NO_DEFAULT_PATH
   )
 
@@ -380,6 +388,7 @@
           ${LIBCXXABI_LIBUNWIND_PATH}/include
           ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES}
           ${LLVM_MAIN_SRC_DIR}/projects/libunwind/include
+          ${LLVM_MAIN_SRC_DIR}/runtimes/libunwind/include
     NO_DEFAULT_PATH
   )
 
@@ -389,6 +398,7 @@
     PATHS ${LIBCXXABI_LIBUNWIND_PATH}/src/
           ${LIBCXXABI_LIBUNWIND_INCLUDES}/../src/
           ${LLVM_MAIN_SRC_DIR}/projects/libunwind/src/
+          ${LLVM_MAIN_SRC_DIR}/runtimes/libunwind/src/
     NO_DEFAULT_PATH
   )
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26362.77308.patch
Type: text/x-patch
Size: 1788 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161109/73f4cee9/attachment.bin>


More information about the llvm-commits mailing list