[PATCH] D56479: [compiler-rt] Add option to disable libc++ build

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 13 16:51:41 PST 2019


smeenai updated this revision to Diff 181492.
smeenai edited the summary of this revision.
smeenai added a comment.

Take HAVE_LIBCXX into account


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56479/new/

https://reviews.llvm.org/D56479

Files:
  compiler-rt/CMakeLists.txt


Index: compiler-rt/CMakeLists.txt
===================================================================
--- compiler-rt/CMakeLists.txt
+++ compiler-rt/CMakeLists.txt
@@ -428,15 +428,23 @@
 
 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()
+set(COMPILER_RT_USE_LIBCXX_DEFAULT OFF)
+if(HAVE_LIBCXX OR LLVM_TOOL_LIBCXX_BUILD)
+  set(COMPILER_RT_USE_LIBCXX_DEFAULT ON)
+endif()
+option(COMPILER_RT_USE_LIBCXX
+    "Enable compiler-rt to use libc++ from the source tree" ${COMPILER_RT_USE_LIBCXX_DEFAULT})
+if(COMPILER_RT_USE_LIBCXX)
+  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.181492.patch
Type: text/x-patch
Size: 1337 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190114/b44fd2f0/attachment.bin>


More information about the llvm-commits mailing list