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
41 LIBCXX_GENERATED_INCLUDE_DIR
42 LIBCXX_GENERATED_INCLUDE_TARGET_DIR
45 llvm_canonicalize_cmake_booleans(LLDB_HAS_LIBCXX)
47 # Generate lldb-dotest Python driver script for each build mode.
48 if(LLDB_BUILT_STANDALONE)
50 if(CMAKE_CONFIGURATION_TYPES)
51 set(config_types ${CMAKE_CONFIGURATION_TYPES})
53 foreach(config_type ${config_types})
54 # In paths to our build-tree, replace CMAKE_CFG_INTDIR with our actual configuration names.
55 string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} config_runtime_output_dir ${LLVM_RUNTIME_OUTPUT_INTDIR})
57 string(REPLACE ${LLVM_RUNTIME_OUTPUT_INTDIR} ${config_runtime_output_dir} "${var}_CONFIGURED" "${${var}}")
60 # Remaining ones must be paths to the provided LLVM build-tree.
61 if(${config_type} IN_LIST LLVM_CONFIGURATION_TYPES)
62 # Multi-configuration generator like Xcode (with a matching config).
64 string(REPLACE ${CMAKE_CFG_INTDIR} ${config_type} "${var}_CONFIGURED" "${${var}}")
67 # Single-configuration generator like Ninja.
69 string(REPLACE ${CMAKE_CFG_INTDIR} "." "${var}_CONFIGURED" "${${var}}")
75 ${config_runtime_output_dir}/lldb-dotest @ONLY
78 elseif(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
79 foreach(LLVM_BUILD_MODE ${CMAKE_CONFIGURATION_TYPES})
80 string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_DOTEST_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
82 string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} "${var}_CONFIGURED" "${${var}}")
87 ${LLDB_DOTEST_DIR}/lldb-dotest
92 set("${var}_CONFIGURED" "${${var}}")
97 ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-dotest