[compiler-rt] r271749 - [CMake] Support constructing output paths from LLVM variables

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 3 16:15:04 PDT 2016


Author: cbieneman
Date: Fri Jun  3 18:15:04 2016
New Revision: 271749

URL: http://llvm.org/viewvc/llvm-project?rev=271749&view=rev
Log:
[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.

Modified:
    compiler-rt/trunk/cmake/base-config-ix.cmake

Modified: compiler-rt/trunk/cmake/base-config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/base-config-ix.cmake?rev=271749&r1=271748&r2=271749&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/base-config-ix.cmake (original)
+++ compiler-rt/trunk/cmake/base-config-ix.cmake Fri Jun  3 18:15:04 2016
@@ -9,7 +9,13 @@ check_include_file(unwind.h HAVE_UNWIND_
 # 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.




More information about the llvm-commits mailing list