Skip to content

Commit 0423551

Browse files
Attempt to fix cryptic linker error
Only include dpcpp_kernels.hpp for non-coverage. Only build dpcpp_kernel for non-coverage, and only link it to dpctl_c_api_tests in this case
1 parent 649bd19 commit 0423551

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

dpctl-capi/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ elseif(UNIX)
8686
"-Wuninitialized "
8787
"-Wmissing-declarations "
8888
"-fdiagnostics-color=auto "
89+
"-Wno-deprecated-declarations "
8990
)
9091
string(CONCAT SDL_FLAGS
9192
"-fstack-protector "

dpctl-capi/tests/CMakeLists.txt

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

24-
add_library(dpcpp_kernels
25-
STATIC
26-
${CMAKE_CURRENT_SOURCE_DIR}/dpcpp_kernels.cpp
27-
)
28-
2924
if(DPCTL_GENERATE_COVERAGE)
3025
file(GLOB_RECURSE
3126
sources ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
@@ -61,7 +56,6 @@ if(DPCTL_GENERATE_COVERAGE)
6156
GTest::GTest
6257
${IntelSycl_OPENCL_LIBRARY}
6358
${CMAKE_DL_LIBS}
64-
dpcpp_kernels
6559
)
6660
add_custom_target(llvm-cov
6761
COMMAND ${CMAKE_MAKE_PROGRAM} dpctl_c_api_tests
@@ -96,14 +90,18 @@ if(DPCTL_GENERATE_COVERAGE)
9690
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
9791
)
9892
else()
93+
add_library(dpcpp_kernels
94+
STATIC
95+
${CMAKE_CURRENT_SOURCE_DIR}/dpcpp_kernels.cpp
96+
)
9997
file(GLOB_RECURSE sources ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
10098
add_executable(dpctl_c_api_tests EXCLUDE_FROM_ALL ${sources})
10199
target_link_libraries(dpctl_c_api_tests
102100
${CMAKE_THREAD_LIBS_INIT}
103101
GTest::GTest
104102
DPCTLSyclInterface
105103
${LEVEL_ZERO_LIBRARY}
106-
dpcpp_kernels
104+
dpcpp_kernels
107105
)
108106
endif()
109107

dpctl-capi/tests/test_sycl_queue_submit.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
//===----------------------------------------------------------------------===//
2525

2626
#include "Support/CBindingWrapping.h"
27+
#ifndef DPCTL_COVERAGE
2728
#include "dpcpp_kernels.hpp"
29+
#endif
2830
#include "dpctl_sycl_context_interface.h"
2931
#include "dpctl_sycl_device_interface.h"
3032
#include "dpctl_sycl_device_selector_interface.h"

0 commit comments

Comments
 (0)