1 include(AddLLVM) # for configure_lit_site_cfg and add_lit_testsuite
2 include(HandleLitArguments)
3 macro(pythonize_bool var)
11 pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)
13 if (LIBCXXABI_ENABLE_SHARED)
14 set(LIBCXXABI_TEST_DEPS cxxabi_shared)
16 set(LIBCXXABI_TEST_DEPS cxxabi_static)
19 list(APPEND LIBCXXABI_TEST_DEPS cxx)
20 if (LIBCXXABI_USE_LLVM_UNWINDER AND TARGET unwind)
21 list(APPEND LIBCXXABI_TEST_DEPS unwind)
24 set(AUTO_GEN_COMMENT "## Autogenerated by libcxxabi configuration.\n# Do not edit!")
25 set(SERIALIZED_LIT_PARAMS "# Lit parameters serialized here for llvm-lit to pick them up\n")
27 if (LIBCXXABI_EXECUTOR)
28 message(DEPRECATION "LIBCXXABI_EXECUTOR is deprecated, please add executor=... to LIBCXXABI_TEST_PARAMS")
29 serialize_lit_string_param(SERIALIZED_LIT_PARAMS executor "${LIBCXXABI_EXECUTOR}")
32 if (NOT LIBCXXABI_ENABLE_EXCEPTIONS)
33 serialize_lit_param(SERIALIZED_LIT_PARAMS enable_exceptions False)
36 if (LIBCXXABI_ENABLE_ASSERTIONS)
37 serialize_lit_param(SERIALIZED_LIT_PARAMS enable_assertions True)
40 serialize_lit_param(SERIALIZED_LIT_PARAMS enable_experimental False)
42 if (LLVM_USE_SANITIZER)
43 serialize_lit_string_param(SERIALIZED_LIT_PARAMS use_sanitizer "${LLVM_USE_SANITIZER}")
46 if (CMAKE_CXX_COMPILER_TARGET)
47 serialize_lit_string_param(SERIALIZED_LIT_PARAMS target_triple "${CMAKE_CXX_COMPILER_TARGET}")
49 serialize_lit_string_param(SERIALIZED_LIT_PARAMS target_triple "${LLVM_DEFAULT_TARGET_TRIPLE}")
52 serialize_lit_params_list(SERIALIZED_LIT_PARAMS LIBCXXABI_TEST_PARAMS)
54 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/configs/cmake-bridge.cfg.in"
55 "${CMAKE_CURRENT_BINARY_DIR}/cmake-bridge.cfg"
58 configure_lit_site_cfg(
59 "${LIBCXXABI_TEST_CONFIG}"
60 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
61 MAIN_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py")
63 add_lit_testsuite(check-cxxabi "Running libcxxabi tests"
64 ${CMAKE_CURRENT_BINARY_DIR}
65 DEPENDS ${LIBCXXABI_TEST_DEPS})