summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2016-10-19 12:18:34 +0000
committerMichal Gorny <mgorny@gentoo.org>2016-10-19 12:18:34 +0000
commite22b7f5aead4a4dd0afa2f5d6d13986d5f000de5 (patch)
treeb61ad09b880f2e4975548b889b9c2d89932469a9 /llvm
parentfbfd173447b64d9d73c44cf47bafeb68e8139e5a (diff)
downloadbcm5719-llvm-e22b7f5aead4a4dd0afa2f5d6d13986d5f000de5.tar.gz
bcm5719-llvm-e22b7f5aead4a4dd0afa2f5d6d13986d5f000de5.zip
[cmake] Declare LLVM_CMAKE_PATH for use in subprojects
Declare the LLVM_CMAKE_PATH to the source directory location of CMake files, in order to make it possible to easily use them in subprojects. Such a variable is already declared in most of LLVM projects (and inconsistently mixed with direct source tree references), including Clang, LLDB, compiler-rt, libcxx... Declaring it inside main LLVM tree makes it possible to avoid having to declare fallback values or use conditionals in those projects. It should be noted that in some of the subprojects LLVM_CMAKE_PATH is used to reference generated LLVMConfig.cmake file. However, these references are conditional to stand-alone builds and explicitly including this file is unnecessary in combined builds. Differential Revision: https://reviews.llvm.org/D25724 llvm-svn: 284581
Diffstat (limited to 'llvm')
-rw-r--r--llvm/CMakeLists.txt2
-rw-r--r--llvm/lib/LTO/CMakeLists.txt2
2 files changed, 3 insertions, 1 deletions
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 4d4aa9f69f9..cc6e583251a 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -263,6 +263,8 @@ set(LLVM_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR} ) # --src-root
set(LLVM_MAIN_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/include ) # --includedir
set(LLVM_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} ) # --prefix
+# Note: LLVM_CMAKE_PATH does not include generated files
+set(LLVM_CMAKE_PATH ${LLVM_MAIN_SRC_DIR}/cmake/modules)
set(LLVM_EXAMPLES_BINARY_DIR ${LLVM_BINARY_DIR}/examples)
set(LLVM_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/include)
diff --git a/llvm/lib/LTO/CMakeLists.txt b/llvm/lib/LTO/CMakeLists.txt
index 3b1e8be09ac..a8704b4c579 100644
--- a/llvm/lib/LTO/CMakeLists.txt
+++ b/llvm/lib/LTO/CMakeLists.txt
@@ -21,7 +21,7 @@ find_first_existing_vc_file(llvm_vc "${LLVM_MAIN_SRC_DIR}")
# The VC revision include that we want to generate.
set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/LLVMLTORevision.h")
-set(get_svn_script "${LLVM_MAIN_SRC_DIR}/cmake/modules/GenerateVersionFromCVS.cmake")
+set(get_svn_script "${LLVM_CMAKE_PATH}/GenerateVersionFromCVS.cmake")
if(DEFINED llvm_vc)
# Create custom target to generate the VC revision include.
OpenPOWER on IntegriCloud