Skip to content

Commit 42e43b9

Browse files
libsyclinterface/tests/test_helper.cpp needs SYCL
1 parent 5a3e60c commit 42e43b9

File tree

1 file changed

+31
-12
lines changed

1 file changed

+31
-12
lines changed

libsyclinterface/tests/CMakeLists.txt

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,38 @@ foreach(tf ${spirv-test-files})
2121
file(COPY ${tf} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
2222
endforeach()
2323

24-
if(DPCTL_GENERATE_COVERAGE)
25-
file(GLOB_RECURSE
26-
sources ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
27-
)
24+
file(GLOB_RECURSE
25+
sources ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
26+
)
2827

29-
# Add all dpctl sources into a single executable so that we can run coverage
30-
# analysis and generate a report.
31-
add_executable(dpctl_c_api_tests
32-
EXCLUDE_FROM_ALL
33-
${sources}
34-
)
28+
# Add all dpctl sources into a single executable so that we can run coverage
29+
# analysis and generate a report.
30+
add_executable(dpctl_c_api_tests
31+
EXCLUDE_FROM_ALL
32+
${sources}
33+
)
34+
add_sycl_to_target(
35+
TARGET dpctl_c_api_tests
36+
SOURCES
37+
${CMAKE_CURRENT_SOURCE_DIR}/test_helper.cpp
38+
${CMAKE_CURRENT_SOURCE_DIR}/test_sycl_queue_manager.cpp
39+
${CMAKE_CURRENT_SOURCE_DIR}/test_sycl_queue_submit.cpp
40+
${CMAKE_CURRENT_SOURCE_DIR}/test_sycl_context_interface.cpp
41+
${CMAKE_CURRENT_SOURCE_DIR}/test_sycl_usm_interface.cpp
42+
${CMAKE_CURRENT_SOURCE_DIR}/test_sycl_queue_interface.cpp
43+
${CMAKE_CURRENT_SOURCE_DIR}/test_sycl_platform_invalid_filters.cpp
44+
${CMAKE_CURRENT_SOURCE_DIR}/test_sycl_device_aspects.cpp
45+
${CMAKE_CURRENT_SOURCE_DIR}/test_sycl_event_interface.cpp
46+
${CMAKE_CURRENT_SOURCE_DIR}/test_sycl_kernel_interface.cpp
47+
${CMAKE_CURRENT_SOURCE_DIR}/test_sycl_kernel_bundle_interface.cpp
48+
${CMAKE_CURRENT_SOURCE_DIR}/test_sycl_device_invalid_filters.cpp
49+
${CMAKE_CURRENT_SOURCE_DIR}/test_sycl_device_subdevices.cpp
50+
${CMAKE_CURRENT_SOURCE_DIR}/test_sycl_device_interface.cpp
51+
${CMAKE_CURRENT_SOURCE_DIR}/test_sycl_device_selector_interface.cpp
52+
${CMAKE_CURRENT_SOURCE_DIR}/test_sycl_platform_interface.cpp
53+
)
54+
55+
if(DPCTL_GENERATE_COVERAGE)
3556
target_include_directories(dpctl_c_api_tests
3657
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../helper/include"
3758
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../include"
@@ -90,8 +111,6 @@ if(DPCTL_GENERATE_COVERAGE)
90111
DEPENDS dpctl_c_api_tests
91112
)
92113
else()
93-
file(GLOB_RECURSE sources ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
94-
add_executable(dpctl_c_api_tests EXCLUDE_FROM_ALL ${sources})
95114
target_link_libraries(dpctl_c_api_tests
96115
${CMAKE_THREAD_LIBS_INIT}
97116
GTest::GTest

0 commit comments

Comments
 (0)