cling/test/CMakeLists.txt

63 lines
1.8 KiB
CMake
Raw Normal View History

2016-08-08 12:13:29 +03:00
#------------------------------------------------------------------------------
# CLING - the C++ LLVM-based InterpreterG :)
#
# This file is dual-licensed: you can choose to license it under the University
# of Illinois Open Source License or the GNU Lesser General Public License. See
# LICENSE.TXT for details.
#------------------------------------------------------------------------------
2014-01-07 14:57:25 +04:00
if (CMAKE_CFG_INTDIR STREQUAL ".")
set(LLVM_BUILD_MODE ".")
else ()
set(LLVM_BUILD_MODE "%(build_mode)s")
endif ()
2013-05-03 16:14:17 +04:00
# Needed for '%shlibext'
set(TARGET_SHLIBEXT "${CMAKE_SHARED_LIBRARY_SUFFIX}")
configure_lit_site_cfg(
2013-05-03 16:14:17 +04:00
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
)
option(CLING_TEST_USE_VG "Run Cling tests under Valgrind" OFF)
if(CLING_TEST_USE_VG)
set(CLING_TEST_EXTRA_ARGS ${CLING_TEST_EXTRA_ARGS} "--vg")
endif ()
list(APPEND CLING_TEST_DEPS cling)
if (TARGET llvm-config)
list(APPEND CLING_TEST_DEPS llvm-config)
endif()
if (TARGET FileCheck)
list(APPEND CLING_TEST_DEPS FileCheck)
endif()
if (TARGET opt)
list(APPEND CLING_TEST_DEPS opt)
endif()
if (TARGET not)
list(APPEND CLING_TEST_DEPS not)
endif()
if (TARGET clang)
list(APPEND CLING_TEST_DEPS clang)
endif()
set(CLING_TEST_PARAMS
cling_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
)
2018-11-20 12:50:42 +03:00
add_custom_target(cling-test-depends DEPENDS clingDemoPlugin ${CLING_TEST_DEPS})
add_lit_testsuite(check-cling "Running the Cling regression tests"
${CMAKE_CURRENT_BINARY_DIR}
PARAMS ${CLING_TEST_PARAMS}
DEPENDS ${CLING_TEST_DEPS}
ARGS ${CLING_TEST_EXTRA_ARGS}
)
set_target_properties(check-cling PROPERTIES FOLDER "Cling tests")
# Add a legacy target spelling: cling-test
add_custom_target(cling-test)
add_dependencies(cling-test check-cling)
set_target_properties(cling-test PROPERTIES FOLDER "Cling tests")