2010-12-11 03:47:54 +08:00
|
|
|
macro(pythonize_bool var)
|
|
|
|
if (${var})
|
|
|
|
set(${var} True)
|
|
|
|
else()
|
|
|
|
set(${var} False)
|
|
|
|
endif()
|
|
|
|
endmacro()
|
|
|
|
|
2015-07-31 06:30:34 +08:00
|
|
|
set(LIBCXX_LIT_VARIANT "libcxx" CACHE STRING
|
|
|
|
"Configuration variant to use for LIT.")
|
|
|
|
|
|
|
|
pythonize_bool(LIBCXX_ENABLE_EXCEPTIONS)
|
2016-05-04 05:30:18 +08:00
|
|
|
pythonize_bool(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
|
2016-06-18 03:46:40 +08:00
|
|
|
pythonize_bool(LIBCXX_ENABLE_FILESYSTEM)
|
2015-07-31 06:30:34 +08:00
|
|
|
pythonize_bool(LIBCXX_ENABLE_RTTI)
|
|
|
|
pythonize_bool(LIBCXX_ENABLE_SHARED)
|
|
|
|
pythonize_bool(LIBCXX_BUILD_32_BITS)
|
|
|
|
pythonize_bool(LIBCXX_GENERATE_COVERAGE)
|
2016-04-19 20:49:05 +08:00
|
|
|
pythonize_bool(LIBCXXABI_ENABLE_SHARED)
|
2015-07-31 06:30:34 +08:00
|
|
|
pythonize_bool(LIBCXXABI_USE_LLVM_UNWINDER)
|
2016-02-11 20:43:04 +08:00
|
|
|
pythonize_bool(LIBCXX_HAS_ATOMIC_LIB)
|
2015-07-31 06:30:34 +08:00
|
|
|
|
|
|
|
# The tests shouldn't link to any ABI library when it has been linked into
|
2015-10-15 03:54:03 +08:00
|
|
|
# libc++ statically or via a linker script.
|
|
|
|
if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY OR LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
|
2015-07-31 06:30:34 +08:00
|
|
|
set(LIBCXX_CXX_ABI_LIBNAME "none")
|
2015-02-04 02:47:37 +08:00
|
|
|
endif()
|
2015-10-15 03:54:03 +08:00
|
|
|
|
2016-04-19 20:49:05 +08:00
|
|
|
# By default, for non-standalone builds, libcxx and libcxxabi share a library
|
|
|
|
# directory.
|
|
|
|
if (NOT LIBCXX_CXX_ABI_LIBRARY_PATH)
|
|
|
|
set(LIBCXX_CXX_ABI_LIBRARY_PATH "${LIBCXX_LIBRARY_DIR}" CACHE PATH
|
|
|
|
"The path to libc++abi library.")
|
|
|
|
endif()
|
|
|
|
|
2015-07-31 06:30:34 +08:00
|
|
|
set(LIBCXX_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING
|
|
|
|
"TargetInfo to use when setting up test environment.")
|
|
|
|
set(LIBCXX_EXECUTOR "None" CACHE STRING
|
|
|
|
"Executor to use when running tests.")
|
|
|
|
|
|
|
|
set(AUTO_GEN_COMMENT "## Autogenerated by libcxx configuration.\n# Do not edit!")
|
|
|
|
|
|
|
|
configure_file(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
|
|
|
@ONLY)
|
|
|
|
|
2016-05-04 05:58:07 +08:00
|
|
|
if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
|
|
|
|
set(experimental_dep cxx_experimental)
|
|
|
|
endif()
|
|
|
|
|
2015-07-31 06:30:34 +08:00
|
|
|
add_lit_testsuite(check-libcxx
|
|
|
|
"Running libcxx tests"
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
2016-05-04 05:58:07 +08:00
|
|
|
DEPENDS cxx ${experimental_dep})
|
2015-07-31 06:30:34 +08:00
|
|
|
|
|
|
|
if (LIBCXX_GENERATE_COVERAGE)
|
|
|
|
include(CodeCoverage)
|
|
|
|
set(output_dir "${CMAKE_CURRENT_BINARY_DIR}/coverage")
|
2016-05-09 07:08:50 +08:00
|
|
|
set(capture_dirs "${LIBCXX_LIB_CMAKEFILES_DIR}/cxx.dir/;${LIBCXX_LIB_CMAKEFILES_DIR}/cxx_experimental.dir/;${CMAKE_CURRENT_BINARY_DIR}")
|
2015-07-31 06:30:34 +08:00
|
|
|
set(extract_dirs "${LIBCXX_SOURCE_DIR}/include;${LIBCXX_SOURCE_DIR}/src")
|
|
|
|
setup_lcov_test_target_coverage("cxx" "${output_dir}" "${capture_dirs}" "${extract_dirs}")
|
2010-12-11 03:47:54 +08:00
|
|
|
endif()
|