summaryrefslogtreecommitdiffstats
path: root/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake')
-rw-r--r--libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake10
1 files changed, 9 insertions, 1 deletions
diff --git a/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake b/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
index 934dfcd7bb1..349d234e198 100644
--- a/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ b/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -61,8 +61,16 @@ macro(find_llvm_parts)
set(LLVM_FOUND ON)
endmacro(find_llvm_parts)
+# If this is a standalone build not running as an external project of LLVM
+# we need to later make some decisions differently.
+if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ # The intent is that this doesn't necessarily mean the LLVM is installed (it
+ # could be a build directory), but it means we need to treat the LLVM
+ # directory as read-only.
+ set(LIBCXX_USING_INSTLLED_LLVM 1)
+endif()
-if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXX_STANDALONE_BUILD)
+if (LIBCXX_USING_INSTLLED_LLVM OR LIBCXX_STANDALONE_BUILD)
set(LIBCXX_STANDALONE_BUILD 1)
message(STATUS "Configuring for standalone build.")
OpenPOWER on IntegriCloud