forked from KhronosGroup/SPIRV-LLVM-Translator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
42 lines (39 loc) · 1.06 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# required by lit.site.cfg.py.in
get_target_property(LLVM_SPIRV_DIR llvm-spirv BINARY_DIR)
set(LLVM_SPIRV_TEST_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py
MAIN_CONFIG
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
)
if(NOT BUILD_EXTERNAL)
set(LLVM_SPIRV_TEST_DEPS
count
FileCheck
not
)
endif(NOT BUILD_EXTERNAL)
add_lit_testsuite(check-llvm-spirv "Running the LLVM-SPIRV regression tests"
${CMAKE_CURRENT_BINARY_DIR}
ARGS
--verbose
DEPENDS
${LLVM_SPIRV_TEST_DEPS}
llvm-as
llvm-dis
llvm-spirv
)
# to enable a custom test target on cmake below 3.11
# starting with 3.11 "test" is only reserved if ENABLE_TESTING(ON)
if(BUILD_EXTERNAL)
cmake_policy(PUSH)
if(POLICY CMP0037 AND ${CMAKE_VERSION} VERSION_LESS "3.11.0")
cmake_policy(SET CMP0037 OLD)
endif(POLICY CMP0037 AND ${CMAKE_VERSION} VERSION_LESS "3.11.0")
add_custom_target(test
DEPENDS
check-llvm-spirv
)
cmake_policy(POP)
endif(BUILD_EXTERNAL)