diff --git a/clang/test/Unit/lit.site.cfg.py.in b/clang/test/Unit/lit.site.cfg.py.in --- a/clang/test/Unit/lit.site.cfg.py.in +++ b/clang/test/Unit/lit.site.cfg.py.in @@ -19,6 +19,7 @@ config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params config.llvm_build_mode = config.llvm_build_mode % lit_config.params + config.shlibdir = config.shlibdir % lit_config.params except KeyError: e = sys.exc_info()[1] key, = e.args diff --git a/lld/test/CMakeLists.txt b/lld/test/CMakeLists.txt --- a/lld/test/CMakeLists.txt +++ b/lld/test/CMakeLists.txt @@ -1,8 +1,11 @@ -set(LLVM_SOURCE_DIR "${LLVM_MAIN_SRC_DIR}") -set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}") -set(LLVM_BUILD_MODE "%(build_mode)s") -set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s") -set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/%(build_config)s") +if (CMAKE_CFG_INTDIR STREQUAL ".") + set(LLVM_BUILD_MODE ".") +else () + set(LLVM_BUILD_MODE "%(build_mode)s") +endif () + +string(REPLACE "${CMAKE_CFG_INTDIR}" "${LLVM_BUILD_MODE}" LLD_LIBS_DIR "${LLVM_LIBRARY_OUTPUT_INTDIR}") +string(REPLACE "${CMAKE_CFG_INTDIR}" "${LLVM_BUILD_MODE}" LLD_TOOLS_DIR "${LLVM_RUNTIME_OUTPUT_INTDIR}") llvm_canonicalize_cmake_booleans( LLVM_ENABLE_ZLIB diff --git a/lld/test/Unit/lit.site.cfg.py.in b/lld/test/Unit/lit.site.cfg.py.in --- a/lld/test/Unit/lit.site.cfg.py.in +++ b/lld/test/Unit/lit.site.cfg.py.in @@ -8,8 +8,8 @@ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.lld_obj_root = "@LLD_BINARY_DIR@" config.lld_src_root = "@LLD_SOURCE_DIR@" -config.lld_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@" -config.lld_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@" +config.lld_libs_dir = "@LLD_LIBS_DIR@" +config.lld_tools_dir = "@LLD_TOOLS_DIR@" config.target_triple = "@TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" @@ -19,6 +19,8 @@ config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params config.llvm_build_mode = config.llvm_build_mode % lit_config.params + config.lld_libs_dir = config.lld_libs_dir % lit_config.params + config.lld_tools_dir = config.lld_tools_dir % lit_config.params except KeyError as e: key, = e.args lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) diff --git a/lld/test/lit.site.cfg.py.in b/lld/test/lit.site.cfg.py.in --- a/lld/test/lit.site.cfg.py.in +++ b/lld/test/lit.site.cfg.py.in @@ -9,8 +9,8 @@ config.llvm_libs_dir = "@LLVM_LIBS_DIR@" config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.lld_obj_root = "@LLD_BINARY_DIR@" -config.lld_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@" -config.lld_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@" +config.lld_libs_dir = "@LLD_LIBS_DIR@" +config.lld_tools_dir = "@LLD_TOOLS_DIR@" config.target_triple = "@TARGET_TRIPLE@" config.python_executable = "@Python3_EXECUTABLE@" config.have_zlib = @LLVM_ENABLE_ZLIB@ @@ -23,6 +23,8 @@ try: config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params + config.lld_libs_dir = config.lld_libs_dir % lit_config.params + config.lld_tools_dir = config.lld_tools_dir % lit_config.params except KeyError as e: key, = e.args lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) diff --git a/lldb/test/API/lit.site.cfg.py.in b/lldb/test/API/lit.site.cfg.py.in --- a/lldb/test/API/lit.site.cfg.py.in +++ b/lldb/test/API/lit.site.cfg.py.in @@ -55,6 +55,7 @@ config.lldb_executable = config.lldb_executable % lit_config.params config.lldb_libs_dir = config.lldb_libs_dir % lit_config.params config.test_compiler = config.test_compiler % lit_config.params + config.dsymutil = config.dsymutil % lit_config.params config.server = config.server % lit_config.params config.lldb_framework_dir = config.lldb_framework_dir % lit_config.params config.dotest_args_str = config.dotest_args_str % lit_config.params diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -1588,11 +1588,11 @@ set_llvm_build_mode() - # They below might not be the build tree but provided binary tree. + # The below might not be the build tree but provided binary tree. set(LLVM_SOURCE_DIR ${LLVM_MAIN_SRC_DIR}) set(LLVM_BINARY_DIR ${LLVM_BINARY_DIR}) string(REPLACE "${CMAKE_CFG_INTDIR}" "${LLVM_BUILD_MODE}" LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}") - string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLVM_LIBS_DIR "${LLVM_LIBRARY_DIR}") + string(REPLACE "${CMAKE_CFG_INTDIR}" "${LLVM_BUILD_MODE}" LLVM_LIBS_DIR "${LLVM_LIBRARY_DIR}") # SHLIBDIR points the build tree. string(REPLACE "${CMAKE_CFG_INTDIR}" "${LLVM_BUILD_MODE}" SHLIBDIR "${LLVM_SHLIB_OUTPUT_INTDIR}") diff --git a/llvm/test/CMakeLists.txt b/llvm/test/CMakeLists.txt --- a/llvm/test/CMakeLists.txt +++ b/llvm/test/CMakeLists.txt @@ -29,7 +29,7 @@ "LLVM_SOURCE_DIR" "LLVM_BINARY_DIR" "LLVM_TOOLS_DIR" - "LLVM_LIBRARY_DIR" + "LLVM_LIBS_DIR" "SHLIBDIR" ) configure_lit_site_cfg( diff --git a/llvm/test/Unit/lit.site.cfg.py.in b/llvm/test/Unit/lit.site.cfg.py.in --- a/llvm/test/Unit/lit.site.cfg.py.in +++ b/llvm/test/Unit/lit.site.cfg.py.in @@ -14,6 +14,7 @@ try: config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params config.llvm_build_mode = config.llvm_build_mode % lit_config.params + config.shlibdir = config.shlibdir % lit_config.params except KeyError: e = sys.exc_info()[1] key, = e.args diff --git a/llvm/test/lit.site.cfg.py.in b/llvm/test/lit.site.cfg.py.in --- a/llvm/test/lit.site.cfg.py.in +++ b/llvm/test/lit.site.cfg.py.in @@ -7,7 +7,7 @@ config.llvm_src_root = path(r"@LLVM_SOURCE_DIR@") config.llvm_obj_root = path(r"@LLVM_BINARY_DIR@") config.llvm_tools_dir = path(r"@LLVM_TOOLS_DIR@") -config.llvm_lib_dir = path(r"@LLVM_LIBRARY_DIR@") +config.llvm_lib_dir = path(r"@LLVM_LIBS_DIR@") config.llvm_shlib_dir = path(r"@SHLIBDIR@") config.llvm_shlib_ext = "@SHLIBEXT@" config.llvm_exe_ext = "@EXEEXT@" @@ -56,6 +56,7 @@ # used when we can't determine the tool dir at configuration time. try: config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params + config.llvm_lib_dir = config.llvm_lib_dir % lit_config.params config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params except KeyError: e = sys.exc_info()[1] diff --git a/mlir/examples/standalone/test/lit.site.cfg.py.in b/mlir/examples/standalone/test/lit.site.cfg.py.in --- a/mlir/examples/standalone/test/lit.site.cfg.py.in +++ b/mlir/examples/standalone/test/lit.site.cfg.py.in @@ -7,7 +7,7 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_lib_dir = "@LLVM_LIBRARY_DIR@" +config.llvm_lib_dir = "@LLVM_LIBS_DIR@" config.llvm_shlib_dir = "@SHLIBDIR@" config.llvm_shlib_ext = "@SHLIBEXT@" config.llvm_exe_ext = "@EXEEXT@" @@ -35,6 +35,7 @@ # used when we can't determine the tool dir at configuration time. try: config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params + config.llvm_lib_dir = config.llvm_lib_dir % lit_config.params config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params except KeyError: e = sys.exc_info()[1] diff --git a/mlir/integration_test/lit.site.cfg.py.in b/mlir/integration_test/lit.site.cfg.py.in --- a/mlir/integration_test/lit.site.cfg.py.in +++ b/mlir/integration_test/lit.site.cfg.py.in @@ -7,7 +7,7 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_lib_dir = "@LLVM_LIBRARY_DIR@" +config.llvm_lib_dir = "@LLVM_LIBS_DIR@" config.llvm_shlib_dir = "@SHLIBDIR@" config.llvm_shlib_ext = "@SHLIBEXT@" config.llvm_exe_ext = "@EXEEXT@" @@ -38,6 +38,7 @@ # used when we can't determine the tool dir at configuration time. try: config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params + config.llvm_lib_dir = config.llvm_lib_dir % lit_config.params config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params except KeyError: e = sys.exc_info()[1] diff --git a/mlir/test/Unit/lit.site.cfg.py.in b/mlir/test/Unit/lit.site.cfg.py.in --- a/mlir/test/Unit/lit.site.cfg.py.in +++ b/mlir/test/Unit/lit.site.cfg.py.in @@ -17,6 +17,7 @@ try: config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params config.llvm_build_mode = config.llvm_build_mode % lit_config.params + config.shlibdir = config.shlibdir % lit_config.params except KeyError: e = sys.exc_info()[1] key, = e.args diff --git a/mlir/test/lit.site.cfg.py.in b/mlir/test/lit.site.cfg.py.in --- a/mlir/test/lit.site.cfg.py.in +++ b/mlir/test/lit.site.cfg.py.in @@ -7,7 +7,7 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_lib_dir = "@LLVM_LIBRARY_DIR@" +config.llvm_lib_dir = "@LLVM_LIBS_DIR@" config.llvm_shlib_dir = "@SHLIBDIR@" config.llvm_shlib_ext = "@SHLIBEXT@" config.llvm_exe_ext = "@EXEEXT@" @@ -51,6 +51,7 @@ # used when we can't determine the tool dir at configuration time. try: config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params + config.llvm_lib_dir = config.llvm_lib_dir % lit_config.params config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params except KeyError: e = sys.exc_info()[1]