[Lldb-commits] [PATCH] D74148: [lldb\utils] Place lldb-repro in a per-configuration directory to support multi-configuration generators

Stella Stamenova via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 6 11:08:00 PST 2020


stella.stamenova created this revision.
stella.stamenova added a reviewer: JDevlieghere.
Herald added subscribers: lldb-commits, mgorny.
Herald added a project: LLDB.

Currently, lldb-repro is placed in the wrong location for multi-configuration generators. For example, in the case of VS, it is placed in a directory $(Configuration) instead of in each of Debug, Release, etc.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74148

Files:
  lldb/utils/lldb-dotest/CMakeLists.txt
  lldb/utils/lldb-repro/CMakeLists.txt


Index: lldb/utils/lldb-repro/CMakeLists.txt
===================================================================
--- lldb/utils/lldb-repro/CMakeLists.txt
+++ lldb/utils/lldb-repro/CMakeLists.txt
@@ -1,4 +1,23 @@
 add_custom_target(lldb-repro)
 add_dependencies(lldb-repro lldb-test-deps)
 set_target_properties(lldb-repro PROPERTIES FOLDER "lldb utils")
-configure_file(lldb-repro.py ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-repro COPYONLY)
+
+# Generate lldb-repro Python script for each build mode.
+if(LLDB_BUILT_STANDALONE)
+  set(config_types ".")
+  if(CMAKE_CONFIGURATION_TYPES)
+    set(config_types ${CMAKE_CONFIGURATION_TYPES})
+  endif()
+
+  foreach(config_type ${config_types})
+    string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} config_runtime_output_dir ${LLVM_RUNTIME_OUTPUT_INTDIR})
+    configure_file(lldb-repro.py ${config_runtime_output_dir}/lldb-repro COPYONLY)
+  endforeach()
+elseif(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
+  foreach(LLVM_BUILD_MODE ${CMAKE_CONFIGURATION_TYPES})
+    string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_REPRO_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
+    configure_file(lldb-repro.py ${LLDB_REPRO_DIR}/lldb-repro COPYONLY)
+  endforeach()
+else()
+  configure_file(lldb-repro.py ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-repro COPYONLY)
+endif()
Index: lldb/utils/lldb-dotest/CMakeLists.txt
===================================================================
--- lldb/utils/lldb-dotest/CMakeLists.txt
+++ lldb/utils/lldb-dotest/CMakeLists.txt
@@ -53,7 +53,7 @@
   endforeach()
 elseif(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
   foreach(LLVM_BUILD_MODE ${CMAKE_CONFIGURATION_TYPES})
-    string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_DOTEST_DIR_CONFIGURED ${LLVM_RUNTIME_OUTPUT_INTDIR})
+    string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_DOTEST_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
     string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_DOTEST_ARGS_CONFIGURED "${LLDB_DOTEST_ARGS}")
     string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_SOURCE_DIR_CONFIGURED "${LLDB_SOURCE_DIR}")
     string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_BUILD_DIRECTORY_CONFIGURED "${LLDB_TEST_BUILD_DIRECTORY}")
@@ -65,7 +65,7 @@
 
     configure_file(
       lldb-dotest.in
-      ${LLDB_DOTEST_DIR_CONFIGURED}/lldb-dotest
+      ${LLDB_DOTEST_DIR}/lldb-dotest
       )
   endforeach()
 else()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74148.242954.patch
Type: text/x-patch
Size: 2383 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200206/e73ffda8/attachment.bin>


More information about the lldb-commits mailing list