diff --git a/clang/test/CMakeLists.txt b/clang/test/CMakeLists.txt --- a/clang/test/CMakeLists.txt +++ b/clang/test/CMakeLists.txt @@ -33,6 +33,7 @@ "LLVM_LIBS_DIR" "SHLIBDIR" "LLVM_LIT_TOOLS_DIR" + "LLVM_EXTERNAL_LIT" "CLANG_BINARY_DIR" "CLANG_SOURCE_DIR" "CLANG_TOOLS_DIR" diff --git a/clang/test/lit.site.cfg.py.in b/clang/test/lit.site.cfg.py.in --- a/clang/test/lit.site.cfg.py.in +++ b/clang/test/lit.site.cfg.py.in @@ -34,6 +34,7 @@ config.use_z3_solver = lit_config.params.get('USE_Z3_SOLVER', "@USE_Z3_SOLVER@") config.has_plugins = @LLVM_ENABLE_PLUGINS@ config.clang_vendor_uti = "@CLANG_VENDOR_UTI@" +config.llvm_external_lit = path(r"@LLVM_EXTERNAL_LIT@") # Support substitution of the tools and libs dirs with user parameters. This is # used when we can't determine the tool dir at configuration time. diff --git a/clang/test/utils/update_cc_test_checks/lit.local.cfg b/clang/test/utils/update_cc_test_checks/lit.local.cfg --- a/clang/test/utils/update_cc_test_checks/lit.local.cfg +++ b/clang/test/utils/update_cc_test_checks/lit.local.cfg @@ -19,7 +19,7 @@ script_path = os.path.join(config.llvm_src_root, 'utils', 'update_cc_test_checks.py') assert os.path.isfile(script_path) -lit = shell_quote(os.path.join(config.llvm_src_root, 'utils', 'lit', 'lit.py')) +lit = config.llvm_external_lit if config.llvm_external_lit else shell_quote(os.path.join(config.llvm_src_root, 'utils', 'lit', 'lit.py')) python = shell_quote(config.python_executable) config.substitutions.append( ('%update_cc_test_checks', "%s %s %s" % (