1include(AddLLVM) # for add_lit_testsuite
2macro(pythonize_bool var)
3  if (${var})
4    set(${var} True)
5  else()
6    set(${var} False)
7  endif()
8endmacro()
9
10if (NOT DEFINED LIBCXX_ENABLE_SHARED)
11  set(LIBCXX_ENABLE_SHARED ON)
12endif()
13
14pythonize_bool(LIBCXXABI_BUILD_32_BITS)
15pythonize_bool(LIBCXX_ENABLE_SHARED)
16pythonize_bool(LIBCXXABI_ENABLE_SHARED)
17pythonize_bool(LIBCXXABI_ENABLE_THREADS)
18pythonize_bool(LIBCXXABI_ENABLE_EXCEPTIONS)
19pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)
20pythonize_bool(LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY)
21set(LIBCXXABI_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING
22    "TargetInfo to use when setting up test environment.")
23set(LIBCXXABI_EXECUTOR "None" CACHE STRING
24    "Executor to use when running tests.")
25
26set(AUTO_GEN_COMMENT "## Autogenerated by libcxxabi configuration.\n# Do not edit!")
27
28if (LIBCXXABI_ENABLE_SHARED)
29  set(LIBCXXABI_TEST_DEPS cxxabi_shared)
30else()
31  set(LIBCXXABI_TEST_DEPS cxxabi_static)
32endif()
33
34if (LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY)
35  list(APPEND LIBCXXABI_TEST_DEPS cxx_external_threads)
36endif()
37
38if (NOT LIBCXXABI_STANDALONE_BUILD)
39  list(APPEND LIBCXXABI_TEST_DEPS cxx)
40  if (LIBCXXABI_USE_LLVM_UNWINDER)
41    list(APPEND LIBCXXABI_TEST_DEPS unwind)
42  endif()
43endif()
44
45
46configure_lit_site_cfg(
47  ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
48  ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
49
50add_lit_testsuite(check-cxxabi "Running libcxxabi tests"
51  ${CMAKE_CURRENT_BINARY_DIR}
52  DEPENDS ${LIBCXXABI_TEST_DEPS}
53  )
54
55# TODO: This is a legacy target name and should be removed at some point.
56add_custom_target(check-libcxxabi DEPENDS check-cxxabi)
57