[PATCH] D38057: Try again to fix libcxx CMake so that it doesn't break when no LLVM source tree is available
Zachary Turner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 20 09:03:34 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL313763: Make libcxx tests work when llvm sources are not present. (authored by zturner).
Changed prior to commit:
https://reviews.llvm.org/D38057?vs=115909&id=116012#toc
Repository:
rL LLVM
https://reviews.llvm.org/D38057
Files:
libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
llvm/trunk/cmake/modules/AddLLVM.cmake
Index: libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
===================================================================
--- libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ libcxx/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -111,14 +111,17 @@
# the configurator should write the script into.
set(LLVM_LIT_OUTPUT_DIR "${libcxx_BINARY_DIR}/bin")
- # Required LIT Configuration ------------------------------------------------
- # Define the default arguments to use with 'lit', and an option for the user
- # to override.
- set(LIT_ARGS_DEFAULT "-sv --show-xfail --show-unsupported")
- if (MSVC OR XCODE)
- set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
+ if (LLVM_INCLUDE_TESTS)
+ # Required LIT Configuration ------------------------------------------------
+ # Define the default arguments to use with 'lit', and an option for the user
+ # to override.
+ set(LLVM_EXTERNAL_LIT "${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py")
+ set(LIT_ARGS_DEFAULT "-sv --show-xfail --show-unsupported")
+ if (MSVC OR XCODE)
+ set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
+ endif()
+ set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")
endif()
- set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")
# Required doc configuration
if (LLVM_ENABLE_SPHINX)
Index: llvm/trunk/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake
+++ llvm/trunk/cmake/modules/AddLLVM.cmake
@@ -1198,7 +1198,12 @@
cmake_parse_arguments(ARG "ALLOW_EXTERNAL" "" "" ${ARGN})
if (ARG_ALLOW_EXTERNAL)
+ set(LLVM_DEFAULT_EXTERNAL_LIT "${LLVM_EXTERNAL_LIT}")
set (LLVM_EXTERNAL_LIT "" CACHE STRING "Command used to spawn lit")
+ if ("${LLVM_EXTERNAL_LIT}" STREQUAL "")
+ set(LLVM_EXTERNAL_LIT "${LLVM_DEFAULT_EXTERNAL_LIT}")
+ endif()
+
if (NOT "${LLVM_EXTERNAL_LIT}" STREQUAL "")
if (EXISTS ${LLVM_EXTERNAL_LIT})
get_filename_component(LIT_FILE_NAME ${LLVM_EXTERNAL_LIT} NAME)
@@ -1230,9 +1235,7 @@
elseif(NOT "${LLVM_RUNTIME_OUTPUT_INTDIR}" STREQUAL "")
set(LLVM_LIT_BASE_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
else()
- message(WARNING "Could not find suitable output location for llvm-lit."
- "Using default ${CMAKE_CURRENT_BINARY_DIR}/llvm-lit")
- set(LLVM_LIT_BASE_DIR ${CMAKE_CURRENT_BINARY_DIR}/llvm-lit)
+ set(LLVM_LIT_BASE_DIR "")
endif()
# Cache this so we don't have to do it again and have subsequent calls
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38057.116012.patch
Type: text/x-patch
Size: 2607 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170920/42ca2f9a/attachment.bin>
More information about the llvm-commits
mailing list