Skip to content

Commit b59e877

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

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

libsyclinterface/tests/CMakeLists.txt

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,22 @@ 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 ${CMAKE_CURRENT_SOURCE_DIR}/test_helper.cpp
37+
)
38+
39+
if(DPCTL_GENERATE_COVERAGE)
3540
target_include_directories(dpctl_c_api_tests
3641
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../helper/include"
3742
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../include"
@@ -90,8 +95,6 @@ if(DPCTL_GENERATE_COVERAGE)
9095
DEPENDS dpctl_c_api_tests
9196
)
9297
else()
93-
file(GLOB_RECURSE sources ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
94-
add_executable(dpctl_c_api_tests EXCLUDE_FROM_ALL ${sources})
9598
target_link_libraries(dpctl_c_api_tests
9699
${CMAKE_THREAD_LIBS_INIT}
97100
GTest::GTest

0 commit comments

Comments
 (0)