[lldb\utils] Place lldb-repro in a per-configuration directory to support multi-configuration generators

Summary: 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.

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

Subscribers: mgorny, lldb-commits, asmith

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D74148
This commit is contained in:
Stella Stamenova 2020-02-06 12:31:57 -08:00
parent 80e17e5fcc
commit 733923a97d
2 changed files with 22 additions and 3 deletions

View File

@ -53,7 +53,7 @@ if(LLDB_BUILT_STANDALONE)
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 @@ elseif(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
configure_file(
lldb-dotest.in
${LLDB_DOTEST_DIR_CONFIGURED}/lldb-dotest
${LLDB_DOTEST_DIR}/lldb-dotest
)
endforeach()
else()

View File

@ -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()