1 include(AddLLVM) # for add_lit_testsuite
2 macro(pythonize_bool var)
10 pythonize_bool(LIBUNWIND_ENABLE_CET)
11 pythonize_bool(LIBUNWIND_ENABLE_THREADS)
12 pythonize_bool(LIBUNWIND_USES_ARM_EHABI)
13 set(LIBUNWIND_EXECUTOR "\\\"${Python3_EXECUTABLE}\\\" ${LIBUNWIND_LIBCXX_PATH}/utils/run.py" CACHE STRING
14 "Executor to use when running tests.")
16 set(AUTO_GEN_COMMENT "## Autogenerated by libunwind configuration.\n# Do not edit!")
17 set(SERIALIZED_LIT_PARAMS "# Lit parameters serialized here for llvm-lit to pick them up\n")
19 macro(serialize_lit_param param value)
20 string(APPEND SERIALIZED_LIT_PARAMS "config.${param} = ${value}\n")
23 serialize_lit_param(enable_experimental False)
25 if (LLVM_USE_SANITIZER)
26 serialize_lit_param(use_sanitizer "\"${LLVM_USE_SANITIZER}\"")
29 if (CMAKE_CXX_COMPILER_TARGET)
30 serialize_lit_param(target_triple "\"${CMAKE_CXX_COMPILER_TARGET}\"")
32 serialize_lit_param(target_triple "\"${LLVM_DEFAULT_TARGET_TRIPLE}\"")
35 foreach(param IN LISTS LIBUNWIND_TEST_PARAMS)
36 string(REGEX REPLACE "(.+)=(.+)" "\\1" name "${param}")
37 string(REGEX REPLACE "(.+)=(.+)" "\\2" value "${param}")
38 serialize_lit_param("${name}" "\"${value}\"")
41 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/configs/cmake-bridge.cfg.in"
42 "${CMAKE_CURRENT_BINARY_DIR}/cmake-bridge.cfg"
45 configure_lit_site_cfg(
46 "${LIBUNWIND_TEST_CONFIG}"
47 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
48 MAIN_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py")
50 add_lit_testsuite(check-unwind "Running libunwind tests"
51 ${CMAKE_CURRENT_BINARY_DIR}
52 DEPENDS unwind ${LIBUNWIND_TEST_DEPS})