summaryrefslogtreecommitdiffstats
path: root/libcxx/cmake
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2016-10-19 12:34:17 +0000
committerMichal Gorny <mgorny@gentoo.org>2016-10-19 12:34:17 +0000
commit7c3e4ebd92f986cdc3b512cd6983607e135f9c62 (patch)
tree846d39be7cab5ef4e01bfd83c4c3fe774af80b75 /libcxx/cmake
parent0ed2f4e98b506a2044bd0d82784c0b88dd36b90d (diff)
downloadbcm5719-llvm-7c3e4ebd92f986cdc3b512cd6983607e135f9c62.tar.gz
bcm5719-llvm-7c3e4ebd92f986cdc3b512cd6983607e135f9c62.zip
[cmake] Allow testing against installed LLVM with no sources
Adjust the stand-alone build files to accept either CMake files from LLVM_CMAKE_PATH or from LLVM_MAIN_SRC_DIR instead of requiring both. This makes it possible to run libcxx tests on top of installed LLVM and lit, without having to unpack a copy of LLVM sources. Furthermore, it avoids adding duplicate paths. Differential Revision: https://reviews.llvm.org/D25093 llvm-svn: 284583
Diffstat (limited to 'libcxx/cmake')
-rw-r--r--libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake17
1 files changed, 6 insertions, 11 deletions
diff --git a/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake b/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
index cf9fb1040f9..05b0244c3b5 100644
--- a/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ b/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -43,21 +43,16 @@ macro(find_llvm_parts)
return()
endif()
- if (NOT EXISTS ${LLVM_MAIN_SRC_DIR})
- set(LLVM_FOUND OFF)
- message(WARNING "Not found: ${LLVM_MAIN_SRC_DIR}")
- return()
- endif()
-
- if(NOT EXISTS ${LLVM_CMAKE_PATH})
+ if (EXISTS "${LLVM_CMAKE_PATH}")
+ list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
+ elseif (EXISTS "${LLVM_MAIN_SRC_DIR}/cmake/modules")
+ list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules")
+ else()
set(LLVM_FOUND OFF)
- message(WARNING "Not found: ${LLVM_CMAKE_PATH}")
+ message(WARNING "Neither ${LLVM_CMAKE_PATH} nor ${LLVM_MAIN_SRC_DIR}/cmake/modules found")
return()
endif()
- list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
- list(APPEND CMAKE_MODULE_PATH "${LLVM_MAIN_SRC_DIR}/cmake/modules")
-
set(LLVM_FOUND ON)
endmacro(find_llvm_parts)
OpenPOWER on IntegriCloud