-
Notifications
You must be signed in to change notification settings - Fork 122
/
Copy pathCMakeLists.txt
75 lines (61 loc) · 2.56 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
enable_testing()
if(USE_CUDA)
include(CheckLanguage)
enable_language(CUDA)
check_language(CUDA)
endif()
macro(add_test_case testname testfile)
if(BUILD_VINEYARD_TESTS_ALL)
add_executable(${testname} ${testfile})
else()
add_executable(${testname} EXCLUDE_FROM_ALL ${testfile})
endif()
target_include_directories(${testname} PRIVATE ${GLOG_INCLUDE_DIRS})
target_link_libraries(${testname} PRIVATE ${VINEYARD_INSTALL_LIBS} ${GLOG_LIBRARIES})
if(NOT ("${VINEYARD_INSTALL_LIBS}" STREQUAL "vineyard_client"))
if(ARROW_SHARED_LIB)
target_link_libraries(${testname} PRIVATE ${ARROW_SHARED_LIB})
else()
target_link_libraries(${testname} PRIVATE ${ARROW_STATIC_LIB})
endif()
endif()
if(${LIBUNWIND_FOUND})
target_link_libraries(${testname} PRIVATE ${LIBUNWIND_LIBRARIES})
endif()
add_test(${testname} ${testname})
add_dependencies(vineyard_tests ${testname})
endmacro()
file(GLOB TEST_FILES RELATIVE "${PROJECT_SOURCE_DIR}/test"
"${PROJECT_SOURCE_DIR}/test/*.cc"
"${PROJECT_SOURCE_DIR}/test/*.cu"
)
foreach(testfile ${TEST_FILES})
string(REGEX MATCH "^(.*)\\.[^.]*$" dummy ${testfile})
set(testname ${CMAKE_MATCH_1})
if(${testname} STREQUAL "gpumalloc_test" AND NOT USE_CUDA)
continue()
endif()
message(STATUS "Found unit_test - " ${testname})
add_test_case(${testname} ${testfile})
if(USE_CUDA)
target_compile_options(${testname} PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-Xcudafe "--diag_suppress=284 --diag_suppress=815 --diag_suppress=997">)
endif()
if(${testname} STREQUAL "delete_test" OR ${testname} STREQUAL "rpc_delete_test")
target_compile_options(${testname} PRIVATE "-fno-access-control")
endif()
if(${testname} STREQUAL "compressor_test")
target_sources(${testname} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../src/common/compression/compressor.cc)
target_link_libraries(${testname} PRIVATE libzstd_static)
endif()
if(${testname} STREQUAL "allocator_test" OR ${testname} STREQUAL "mimalloc_test")
if(BUILD_VINEYARD_MALLOC)
target_compile_options(${testname} PRIVATE -DWITH_MIMALLOC)
endif()
endif()
if(${testname} STREQUAL "hosseinmoein_dataframe_test")
if(BUILD_VINEYARD_HOSSEINMOEIN_DATAFRAME)
target_compile_options(${testname} PRIVATE -DWITH_HOSSEINMOEIN_DATAFRAME)
set_property(TARGET ${testname} PROPERTY CXX_STANDARD 17)
endif()
endif()
endforeach()