[libcxx] r284583 - [cmake] Allow testing against installed LLVM with no sources
Michal Gorny via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 19 05:34:18 PDT 2016
Author: mgorny
Date: Wed Oct 19 07:34:17 2016
New Revision: 284583
URL: http://llvm.org/viewvc/llvm-project?rev=284583&view=rev
Log:
[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
Modified:
libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
Modified: libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake?rev=284583&r1=284582&r2=284583&view=diff
==============================================================================
--- libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake (original)
+++ libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake Wed Oct 19 07:34:17 2016
@@ -43,21 +43,16 @@ macro(find_llvm_parts)
return()
endif()
- if (NOT EXISTS ${LLVM_MAIN_SRC_DIR})
+ 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_MAIN_SRC_DIR}")
+ message(WARNING "Neither ${LLVM_CMAKE_PATH} nor ${LLVM_MAIN_SRC_DIR}/cmake/modules found")
return()
endif()
- if(NOT EXISTS ${LLVM_CMAKE_PATH})
- set(LLVM_FOUND OFF)
- message(WARNING "Not found: ${LLVM_CMAKE_PATH}")
- 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)
More information about the cfe-commits
mailing list