[PATCH] D56479: [compiler-rt] Respect libc++ build setting

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 9 00:33:23 PST 2019


smeenai created this revision.
smeenai added reviewers: beanz, phosek.
Herald added subscribers: Sanitizers, delcypher, mgorny, dberris.
Herald added a reviewer: EricWF.

Having libc++ checked out doesn't necessarily mean it should be
configured; for example, the same source tree might be used for multiple
build configurations, and libc++ might not build in some of those
configurations. Passing -DLLVM_TOOL_LIBCXX_BUILD=OFF to those
configurations makes LLVM itself not attempt to build libc++, but
compiler-rt still finds the libc++ source and tries to build it, causing
errors. Make compiler-rt respect LLVM_TOOL_LIBCXX_BUILD and not attempt
to use libc++ if that's set to OFF.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D56479

Files:
  CMakeLists.txt


Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -428,15 +428,17 @@
 
 add_subdirectory(include)
 
-foreach(path IN ITEMS ${LLVM_MAIN_SRC_DIR}/projects/libcxx
-                      ${LLVM_MAIN_SRC_DIR}/runtimes/libcxx
-                      ${LLVM_MAIN_SRC_DIR}/../libcxx
-                      ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR})
-  if(IS_DIRECTORY ${path})
-    set(COMPILER_RT_LIBCXX_PATH ${path})
-    break()
-  endif()
-endforeach()
+if(LLVM_TOOL_LIBCXX_BUILD)
+  foreach(path IN ITEMS ${LLVM_MAIN_SRC_DIR}/projects/libcxx
+                        ${LLVM_MAIN_SRC_DIR}/runtimes/libcxx
+                        ${LLVM_MAIN_SRC_DIR}/../libcxx
+                        ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR})
+    if(IS_DIRECTORY ${path})
+      set(COMPILER_RT_LIBCXX_PATH ${path})
+      break()
+    endif()
+  endforeach()
+endif()
 
 set(COMPILER_RT_LLD_PATH ${LLVM_MAIN_SRC_DIR}/tools/lld)
 if(EXISTS ${COMPILER_RT_LLD_PATH}/ AND LLVM_TOOL_LLD_BUILD)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56479.180798.patch
Type: text/x-patch
Size: 1039 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190109/aa2b66af/attachment.bin>


More information about the llvm-commits mailing list