2010-12-10 20:47:54 +01:00
|
|
|
macro(pythonize_bool var)
|
|
|
|
if (${var})
|
|
|
|
set(${var} True)
|
|
|
|
else()
|
|
|
|
set(${var} False)
|
|
|
|
endif()
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
include(FindPythonInterp)
|
|
|
|
if(PYTHONINTERP_FOUND)
|
2013-10-03 23:58:25 +02:00
|
|
|
if(LIBCXX_BUILT_STANDALONE)
|
|
|
|
set(LIT_EXECUTABLE "" CACHE FILEPATH "Path to LLVM's lit.py.")
|
|
|
|
else()
|
|
|
|
set(LIT_EXECUTABLE "${CMAKE_SOURCE_DIR}/utils/lit/lit.py")
|
|
|
|
endif()
|
|
|
|
|
2014-08-23 06:33:20 +02:00
|
|
|
set(LIT_ARGS_DEFAULT "-sv --show-unsupported --show-xfail")
|
2010-12-10 20:47:54 +01:00
|
|
|
if (MSVC OR XCODE)
|
|
|
|
set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
|
|
|
|
endif()
|
|
|
|
set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}"
|
|
|
|
CACHE STRING "Default options for lit")
|
|
|
|
set(LIT_ARGS "${LLVM_LIT_ARGS}")
|
|
|
|
separate_arguments(LIT_ARGS)
|
|
|
|
|
2015-01-15 19:35:04 +01:00
|
|
|
option(LIBCXX_LIT_VARIANT "Configuration variant to use for LIT." "libcxx")
|
|
|
|
|
2014-12-12 03:36:23 +01:00
|
|
|
pythonize_bool(LIBCXX_ENABLE_EXCEPTIONS)
|
|
|
|
pythonize_bool(LIBCXX_ENABLE_RTTI)
|
2010-12-10 20:47:54 +01:00
|
|
|
pythonize_bool(LIBCXX_ENABLE_SHARED)
|
2014-12-12 04:12:18 +01:00
|
|
|
pythonize_bool(LIBCXX_BUILD_32_BITS)
|
2014-12-06 22:02:58 +01:00
|
|
|
pythonize_bool(LIBCXX_ENABLE_THREADS)
|
|
|
|
pythonize_bool(LIBCXX_ENABLE_MONOTONIC_CLOCK)
|
2010-12-10 20:47:54 +01:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
2012-03-19 16:40:23 +01:00
|
|
|
add_custom_target(check-libcxx
|
2010-12-10 20:47:54 +01:00
|
|
|
COMMAND ${PYTHON_EXECUTABLE}
|
|
|
|
${LIT_EXECUTABLE}
|
|
|
|
${LIT_ARGS}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
2013-10-03 23:58:25 +02:00
|
|
|
DEPENDS cxx
|
2010-12-10 20:47:54 +01:00
|
|
|
COMMENT "Running libcxx tests")
|
|
|
|
else()
|
|
|
|
message(WARNING "Could not find Python, no check target will be available!")
|
|
|
|
endif()
|