1 # Make lldb-dotest a custom target.
2 add_custom_target(lldb-dotest)
3 add_dependencies(lldb-dotest lldb-test-depends)
4 set_target_properties(lldb-dotest PROPERTIES FOLDER "lldb utils")
6 get_property(LLDB_TEST_USER_ARGS GLOBAL PROPERTY LLDB_TEST_USER_ARGS_PROPERTY)
7 get_property(LLDB_TEST_COMMON_ARGS GLOBAL PROPERTY LLDB_TEST_COMMON_ARGS_PROPERTY)
8 set(LLDB_LIBS_DIR "${LLVM_LIBRARY_OUTPUT_INTDIR}")
10 llvm_canonicalize_cmake_booleans(
15 if ("libcxx" IN_LIST LLVM_ENABLE_RUNTIMES)
16 set(LLDB_HAS_LIBCXX ON)
17 if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE)
18 set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
19 set(LIBCXX_GENERATED_INCLUDE_DIR "${LLVM_BINARY_DIR}/include/c++/v1")
20 set(LIBCXX_GENERATED_INCLUDE_TARGET_DIR "${LLVM_BINARY_DIR}/include/${LLVM_DEFAULT_TARGET_TRIPLE}/c++/v1")
22 set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
23 set(LIBCXX_GENERATED_INCLUDE_DIR "${CMAKE_BINARY_DIR}/include/c++/v1")
27 set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}")
33 LLDB_TEST_BUILD_DIRECTORY
40 LIBCXX_GENERATED_INCLUDE_DIR
41 LIBCXX_GENERATED_INCLUDE_TARGET_DIR
44 llvm_canonicalize_cmake_booleans(LLDB_HAS_LIBCXX)
46 # Generate lldb-dotest Python driver script for each build mode.
47 if(LLDB_BUILT_STANDALONE)
49 if(CMAKE_CONFIGURATION_TYPES)
50 set(config_types ${CMAKE_CONFIGURATION_TYPES})
52 foreach(config_type ${config_types})
53 # In paths to our build-tree, replace CMAKE_CFG_INTDIR with our actual configuration names.
54 string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} config_runtime_output_dir ${LLVM_RUNTIME_OUTPUT_INTDIR})
56 string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} "${var}_CONFIGURED" "${${var}}")
59 # Remaining ones must be paths to the provided LLVM build-tree.
60 if(${config_type} IN_LIST LLVM_CONFIGURATION_TYPES)
61 # Multi-configuration generator like Xcode (with a matching config).
63 string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} "${var}_CONFIGURED" "${${var}}")
66 # Single-configuration generator like Ninja.
68 string(REPLACE ${CMAKE_CFG_INTDIR} "." "${var}_CONFIGURED" "${${var}}")
74 ${config_runtime_output_dir}/lldb-dotest @ONLY
77 elseif(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
78 foreach(LLVM_BUILD_MODE ${CMAKE_CONFIGURATION_TYPES})
79 string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_DOTEST_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
81 string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} "${var}_CONFIGURED" "${${var}}")
86 ${LLDB_DOTEST_DIR}/lldb-dotest
91 set("${var}_CONFIGURED" "${${var}}")
96 ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-dotest