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
2016-08-08 12:08:09 +03: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
2016-08-06 03:12:08 +03:00
# Needed for '%shlibext'
set ( TARGET_SHLIBEXT "${CMAKE_SHARED_LIBRARY_SUFFIX}" )
2016-08-08 12:08:09 +03:00
configure_lit_site_cfg (
2013-05-03 16:14:17 +04:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / l i t . s i t e . c f g . i n
2016-08-08 12:08:09 +03:00
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / l i t . s i t e . c f g
)
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 ( )
2018-04-19 15:21:09 +03:00
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 ( )
2020-10-28 19:21:50 +03:00
if ( TARGET count )
list ( APPEND CLING_TEST_DEPS count )
endif ( )
2018-04-19 15:21:09 +03:00
if ( TARGET clang )
list ( APPEND CLING_TEST_DEPS clang )
endif ( )
2016-08-08 12:08:09 +03:00
set ( CLING_TEST_PARAMS
c l i n g _ s i t e _ c o n f i g = $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / l i t . s i t e . c f g
)
2018-11-20 12:50:42 +03:00
add_custom_target ( cling-test-depends DEPENDS clingDemoPlugin ${ CLING_TEST_DEPS } )
2016-08-08 12:08:09 +03:00
2020-10-28 19:21:50 +03:00
set ( LLVM_LIT_OUTPUT_DIR "${LLVM_BINARY_DIR}/bin" )
2016-08-08 12:08:09 +03:00
add_lit_testsuite ( check-cling "Running the Cling regression tests"
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R }
P A R A M S $ { C L I N G _ T E S T _ P A R A M S }
D E P E N D S $ { C L I N G _ T E S T _ D E P S }
A R G S $ { C L I N G _ T E S T _ E X T R A _ A R G S }
)
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" )