Skip to content

Commit da50cd7

Browse files
committed
[CL] Fix Windows CMake, remove explicit Linux path
Fixes #1171 by replacing an explicit Linux path used as the value for the internal `OpenCLICDLoaderLibrary` CMake varaible and replacing it with the `OpenCL::OpenCL` target name. This is an target alias provided by the https://github.com/KhronosGroup/OpenCL-ICD-Loader.
1 parent c2d7825 commit da50cd7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

source/adapters/opencl/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,14 @@ if(UR_OPENCL_ICD_LOADER_LIBRARY)
6767
set(OpenCLICDLoaderLibrary ${UR_OPENCL_ICD_LOADER_LIBRARY})
6868
else()
6969
find_package(OpenCL 3.0)
70-
if(OpenCL_FOUND)
71-
set(OpenCLICDLoaderLibrary OpenCL::OpenCL)
72-
else()
70+
if(NOT OpenCL_FOUND)
7371
FetchContent_Declare(OpenCL-ICD-Loader
7472
GIT_REPOSITORY "https://github.com/KhronosGroup/OpenCL-ICD-Loader.git"
7573
GIT_TAG main
7674
)
7775
FetchContent_MakeAvailable(OpenCL-ICD-Loader)
78-
set(OpenCLICDLoaderLibrary ${PROJECT_BINARY_DIR}/lib/libOpenCL.so)
7976
endif()
77+
set(OpenCLICDLoaderLibrary OpenCL::OpenCL)
8078
endif()
8179

8280
message(STATUS "OpenCL Include Directory: ${OpenCLIncludeDirectory}")

0 commit comments

Comments
 (0)