2019-07-24 01:47:08 +08:00
|
|
|
# Make lldb-dotest a custom target.
|
|
|
|
add_custom_target(lldb-dotest)
|
2019-10-08 08:21:34 +08:00
|
|
|
add_dependencies(lldb-dotest lldb-test-deps)
|
2019-07-24 01:47:08 +08:00
|
|
|
set_target_properties(lldb-dotest PROPERTIES FOLDER "lldb utils")
|
|
|
|
|
|
|
|
get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY)
|
2020-02-06 07:15:01 +08:00
|
|
|
set(LLDB_LIBS_DIR "${LLVM_LIBRARY_OUTPUT_INTDIR}")
|
2019-07-24 01:47:08 +08:00
|
|
|
|
|
|
|
# Generate lldb-dotest Python driver 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})
|
|
|
|
# In paths to our build-tree, replace CMAKE_CFG_INTDIR with our actual configuration names.
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} config_runtime_output_dir ${LLVM_RUNTIME_OUTPUT_INTDIR})
|
|
|
|
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}")
|
2020-01-16 07:15:51 +08:00
|
|
|
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_SOURCE_DIR "${LLDB_SOURCE_DIR}")
|
|
|
|
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_BUILD_DIRECTORY "${LLDB_TEST_BUILD_DIRECTORY}")
|
|
|
|
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_EXECUTABLE "${LLDB_TEST_EXECUTABLE}")
|
|
|
|
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_COMPILER "${LLDB_TEST_COMPILER}")
|
|
|
|
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_DSYMUTIL "${LLDB_TEST_DSYMUTIL}")
|
|
|
|
string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} LLDB_TEST_FILECHECK "${LLDB_TEST_FILECHECK}")
|
2019-07-24 01:47:08 +08:00
|
|
|
|
|
|
|
# Remaining ones must be paths to the provided LLVM build-tree.
|
|
|
|
if(${config_type} IN_LIST LLVM_CONFIGURATION_TYPES)
|
|
|
|
# Multi-configuration generator like Xcode (with a matching config).
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}")
|
2020-01-16 07:55:51 +08:00
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_SOURCE_DIR "${LLDB_SOURCE_DIR}")
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_BUILD_DIRECTORY "${LLDB_TEST_BUILD_DIRECTORY}")
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_EXECUTABLE "${LLDB_TEST_EXECUTABLE}")
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_COMPILER "${LLDB_TEST_COMPILER}")
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_DSYMUTIL "${LLDB_TEST_DSYMUTIL}")
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} LLDB_TEST_FILECHECK "${LLDB_TEST_FILECHECK}")
|
2019-07-24 01:47:08 +08:00
|
|
|
else()
|
|
|
|
# Single-configuration generator like Ninja.
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}")
|
2020-01-16 07:55:51 +08:00
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_SOURCE_DIR "${LLDB_SOURCE_DIR}")
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_BUILD_DIRECTORY "${LLDB_TEST_BUILD_DIRECTORY}")
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_EXECUTABLE "${LLDB_TEST_EXECUTABLE}")
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_COMPILER "${LLDB_TEST_COMPILER}")
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_DSYMUTIL "${LLDB_TEST_DSYMUTIL}")
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} "." LLDB_TEST_FILECHECK "${LLDB_TEST_FILECHECK}")
|
2019-07-24 01:47:08 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
configure_file(
|
|
|
|
lldb-dotest.in
|
|
|
|
${config_runtime_output_dir}/lldb-dotest @ONLY
|
|
|
|
)
|
|
|
|
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 ${LLVM_RUNTIME_OUTPUT_INTDIR})
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}")
|
2020-01-16 07:15:51 +08:00
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_SOURCE_DIR "${LLDB_SOURCE_DIR}")
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_BUILD_DIRECTORY "${LLDB_TEST_BUILD_DIRECTORY}")
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_EXECUTABLE "${LLDB_TEST_EXECUTABLE}")
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_COMPILER "${LLDB_TEST_COMPILER}")
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_DSYMUTIL "${LLDB_TEST_DSYMUTIL}")
|
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_FILECHECK "${LLDB_TEST_FILECHECK}")
|
2019-07-24 01:47:08 +08:00
|
|
|
configure_file(
|
|
|
|
lldb-dotest.in
|
|
|
|
${LLDB_DOTEST_DIR}/lldb-dotest
|
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
else()
|
|
|
|
configure_file(
|
|
|
|
lldb-dotest.in
|
|
|
|
${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-dotest
|
|
|
|
)
|
|
|
|
endif()
|