diff --git a/dpcpp/CMakeLists.txt b/dpcpp/CMakeLists.txt index bf65888a6ab..8505fa73d98 100644 --- a/dpcpp/CMakeLists.txt +++ b/dpcpp/CMakeLists.txt @@ -117,7 +117,13 @@ endif() target_include_directories(ginkgo_dpcpp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/..) target_link_libraries(ginkgo_dpcpp PUBLIC ginkgo_device) -target_link_libraries(ginkgo_dpcpp PRIVATE MKL::MKL_DPCPP oneDPL) +target_link_libraries(ginkgo_dpcpp PRIVATE oneDPL) +# MKL 2024.0+ provides the MKL::MKL_SYCL target, while older versions provide *_DPCPP +if(TARGET MKL::MKL_SYCL) + target_link_libraries(ginkgo_dpcpp PRIVATE MKL::MKL_SYCL) +elseif () + target_link_libraries(ginkgo_dpcpp PRIVATE MKL::MKL_DPCPP) +endif () if (GINKGO_DPCPP_SINGLE_MODE) target_compile_definitions(ginkgo_dpcpp PRIVATE GINKGO_DPCPP_SINGLE_MODE=1) endif()