summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-06-03 23:15:04 +0000
committerChris Bieneman <beanz@apple.com>2016-06-03 23:15:04 +0000
commitc0d89826a71aef103c0cddc7d99cb560457e3a9f (patch)
tree2400856d612a08cf1f055760568cd634ae4ea219
parent8a3d717868c3dcca1f4b742b9c2d1232660556c3 (diff)
downloadbcm5719-llvm-c0d89826a71aef103c0cddc7d99cb560457e3a9f.tar.gz
bcm5719-llvm-c0d89826a71aef103c0cddc7d99cb560457e3a9f.zip
[CMake] Support constructing output paths from LLVM variables
This tweak to constructing output paths allows compiler-rt to use LLVM output variables if they are set regardless of whether or not the build is in-tree. llvm-svn: 271749
-rw-r--r--compiler-rt/cmake/base-config-ix.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler-rt/cmake/base-config-ix.cmake b/compiler-rt/cmake/base-config-ix.cmake
index 5d0502c3c5b..5d71fa9c1d6 100644
--- a/compiler-rt/cmake/base-config-ix.cmake
+++ b/compiler-rt/cmake/base-config-ix.cmake
@@ -9,7 +9,13 @@ check_include_file(unwind.h HAVE_UNWIND_H)
# Top level target used to build all compiler-rt libraries.
add_custom_target(compiler-rt ALL)
-if (NOT COMPILER_RT_STANDALONE_BUILD)
+# Setting these variables from an LLVM build is sufficient that compiler-rt can
+# construct the output paths, so it can behave as if it were in-tree here.
+if (LLVM_LIBRARY_OUTPUT_INTDIR AND LLVM_RUNTIME_OUTPUT_INTDIR AND PACKAGE_VERSION)
+ set(LLVM_TREE_AVAILABLE On)
+endif()
+
+if (LLVM_TREE_AVAILABLE)
# Compute the Clang version from the LLVM version.
# FIXME: We should be able to reuse CLANG_VERSION variable calculated
# in Clang cmake files, instead of copying the rules here.
OpenPOWER on IntegriCloud