[Lldb-commits] [PATCH] D43096: [lit] Update how clang and other binaries are found in per-configuration directories

Aaron Smith via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sat Feb 10 14:33:17 PST 2018


asmith updated this revision to Diff 133770.

https://reviews.llvm.org/D43096

Files:
  CMakeLists.txt
  lit/CMakeLists.txt
  lit/lit.site.cfg.in


Index: lit/lit.site.cfg.in
===================================================================
--- lit/lit.site.cfg.in
+++ lit/lit.site.cfg.in
@@ -6,8 +6,8 @@
 config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
 config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
 config.lldb_obj_root = "@LLDB_BINARY_DIR@"
-config.lldb_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@"
-config.lldb_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@"
+config.lldb_libs_dir = "@LLDB_LIBS_DIR@"
+config.lldb_tools_dir = "@LLDB_TOOLS_DIR@"
 config.target_triple = "@TARGET_TRIPLE@"
 config.python_executable = "@PYTHON_EXECUTABLE@"
 config.cc = "@LLDB_TEST_C_COMPILER@"
@@ -19,6 +19,10 @@
 try:
     config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
     config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params
+    config.lldb_libs_dir = config.lldb_libs_dir % lit_config.params
+    config.lldb_tools_dir = config.lldb_tools_dir % lit_config.params
+    config.cc = config.cc % lit_config.params
+    config.cxx = config.cxx % lit_config.params
 except KeyError as e:
     key, = e.args
     lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))
Index: lit/CMakeLists.txt
===================================================================
--- lit/CMakeLists.txt
+++ lit/CMakeLists.txt
@@ -1,10 +1,23 @@
-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")
-set(CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
-set(CLANG_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")
+# Test runner infrastructure for LLDB. This configures the LLDB test trees
+# for use by Lit, and delegates to LLVM's lit test handlers.
+
+if (CMAKE_CFG_INTDIR STREQUAL ".")
+  set(LLVM_BUILD_MODE ".")
+else ()
+  set(LLVM_BUILD_MODE "%(build_mode)s")
+endif ()
+
+if (LLDB_TESTING_DEFAULT_C_COMPILER)
+  string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_C_COMPILER ${LLDB_TEST_C_COMPILER})
+endif ()
+
+if (LLDB_TESTING_DEFAULT_CXX_COMPILER)
+  string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_CXX_COMPILER ${LLDB_TEST_CXX_COMPILER})
+endif ()
+
+string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_LIBS_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
+string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
+
 if(BUILD_SHARED_LIBS)
   set(ENABLE_SHARED 1)
 else()
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -70,6 +70,14 @@
     set(LLDB_DEFAULT_TEST_CXX_COMPILER "")
   endif()
 
+  if ("${LLDB_TEST_C_COMPILER}" STREQUAL "")
+    set(LLDB_TESTING_DEFAULT_C_COMPILER ON)
+  endif()
+
+  if ("${LLDB_TEST_CXX_COMPILER}" STREQUAL "")
+    set(LLDB_TESTING_DEFAULT_CXX_COMPILER ON)
+  endif()
+
   set(LLDB_TEST_C_COMPILER "${LLDB_DEFAULT_TEST_C_COMPILER}" CACHE PATH "C Compiler to use for building LLDB test inferiors")
   set(LLDB_TEST_CXX_COMPILER "${LLDB_DEFAULT_TEST_CXX_COMPILER}" CACHE PATH "C++ Compiler to use for building LLDB test inferiors")
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43096.133770.patch
Type: text/x-patch
Size: 3210 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180210/dc6aba81/attachment.bin>


More information about the lldb-commits mailing list