From cbf08c741afb83e5e4c10dc416e09abe7aa550a9 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Fri, 10 Nov 2017 20:57:57 +0000 Subject: [debuginfo-tests] Make debuginfo-tests work in a standard configuration. Previously, debuginfo-tests was expected to be checked out into clang/test and then the tests would automatically run as part of check-clang. This is not a standard workflow for handling external projects, and it brings with it some serious drawbacks such as the inability to depend on things other than clang, which we will need going forward. The goal of this patch is to migrate towards a more standard workflow. To ease the transition for build bot maintainers, this patch tries not to break the existing workflow, but instead simply deprecate it to give maintainers a chance to update the build infrastructure. Differential Revision: https://reviews.llvm.org/D39605 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317925 91177308-0d34-0410-b5e6-96231b3b80d8 --- CMakeLists.txt | 19 ++++++++++++------- projects/CMakeLists.txt | 1 + utils/lit/lit/llvm/config.py | 9 ++++++--- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 216702eabaf..5d1d29edb41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,7 +110,7 @@ endif() # LLVM_EXTERNAL_${project}_SOURCE_DIR using LLVM_ALL_PROJECTS # This allows an easy way of setting up a build directory for llvm and another # one for llvm+clang+... using the same sources. -set(LLVM_ALL_PROJECTS "clang;libcxx;libcxxabi;lldb;compiler-rt;lld;polly") +set(LLVM_ALL_PROJECTS "clang;libcxx;libcxxabi;lldb;compiler-rt;debuginfo-tests;lld;polly") set(LLVM_ENABLE_PROJECTS "" CACHE STRING "Semicolon-separated list of projects to build (${LLVM_ALL_PROJECTS}), or \"all\".") if( LLVM_ENABLE_PROJECTS STREQUAL "all" ) @@ -881,13 +881,18 @@ if( LLVM_INCLUDE_EXAMPLES ) endif() if( LLVM_INCLUDE_TESTS ) - if(EXISTS ${LLVM_MAIN_SRC_DIR}/projects/test-suite AND TARGET clang) + if(TARGET clang) include(LLVMExternalProjectUtils) - llvm_ExternalProject_Add(test-suite ${LLVM_MAIN_SRC_DIR}/projects/test-suite - USE_TOOLCHAIN - EXCLUDE_FROM_ALL - NO_INSTALL - ALWAYS_CLEAN) + if (EXISTS ${LLVM_MAIN_SRC_DIR}/projects/test-suite) + llvm_ExternalProject_Add(test-suite ${LLVM_MAIN_SRC_DIR}/projects/test-suite + USE_TOOLCHAIN + TOOLCHAIN_TOOLS clang lld clang-cl + EXCLUDE_FROM_ALL + NO_INSTALL + ALWAYS_CLEAN) + endif() + + add_llvm_external_project(debuginfo-tests projects/debuginfo-tests) endif() add_subdirectory(utils/lit) add_subdirectory(test) diff --git a/projects/CMakeLists.txt b/projects/CMakeLists.txt index 9102efbdcb4..11835fa89d2 100644 --- a/projects/CMakeLists.txt +++ b/projects/CMakeLists.txt @@ -10,6 +10,7 @@ foreach(entry ${entries}) (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libcxxabi) AND (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/libunwind) AND (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/test-suite) AND + (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/debuginfo-tests) AND (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/parallel-libs) AND (NOT ${entry} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/openmp)) add_subdirectory(${entry}) diff --git a/utils/lit/lit/llvm/config.py b/utils/lit/lit/llvm/config.py index 798f08af1be..d3d8d2288b7 100644 --- a/utils/lit/lit/llvm/config.py +++ b/utils/lit/lit/llvm/config.py @@ -27,8 +27,9 @@ class LLVMConfig(object): # For tests that require Windows to run. features.add('system-windows') + lit_tools_dir = getattr(config, 'lit_tools_dir', None) # Seek sane tools in directories and set to $PATH. - path = self.lit_config.getToolsPath(config.lit_tools_dir, + path = self.lit_config.getToolsPath(lit_tools_dir, config.environment['PATH'], ['cmp.exe', 'grep.exe', 'sed.exe']) if path is not None: @@ -413,8 +414,10 @@ class LLVMConfig(object): self.config.substitutions.append( ('%target_itanium_abi_host_triple', '')) - self.config.substitutions.append( - ('%src_include_dir', self.config.clang_src_dir + '/include')) + clang_src_dir = getattr(self.config, 'clang_src_dir', None) + if clang_src_dir: + self.config.substitutions.append( + ('%src_include_dir', os.path.join(clang_src_dir, 'include'))) # FIXME: Find nicer way to prohibit this. self.config.substitutions.append( -- cgit v1.2.3