Skip to content

Commit ba999d3

Browse files
committedFeb 27, 2019
[SYCL] Fix linking with renamed OpenCL library.
This change allows configuring OpenCL library name via OpenCL_LIBRARY CMake variable. Signed-off-by: Alexey Bader <alexey.bader@intel.com>
1 parent 9fa2654 commit ba999d3

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed
 

‎sycl/CMakeLists.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ set ( LLVM_INST_INC_DIRECTORY "lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/i
3232
find_package(OpenCL REQUIRED)
3333

3434
include_directories(${OpenCL_INCLUDE_DIRS})
35-
link_libraries(OpenCL)
35+
link_libraries(${OpenCL_LIBRARY})
3636

3737
# Configure SYCL version macro
3838
set(sycl_inc_dir ${CMAKE_CURRENT_SOURCE_DIR}/include/CL)
@@ -103,7 +103,6 @@ add_library("${SYCLLibrary}" SHARED
103103

104104
include_directories("${SYCLLibrary}" "${includeRootPath}")
105105

106-
target_link_libraries("${SYCLLibrary}" "${OpenCL_LIBRARIES}")
107106
set_target_properties("${SYCLLibrary}" PROPERTIES LINKER_LANGUAGE CXX)
108107

109108
# Workaround for bug in GCC version 5.

‎sycl/tools/CMakeLists.txt

-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@ set(CMAKE_CXX_STANDARD 11)
22
set(CMAKE_CXX_STANDARD_REQUIRED ON)
33
set(CMAKE_CXX_EXTENSIONS OFF)
44

5-
find_package(OpenCL REQUIRED)
6-
7-
# All projects need this include directory
8-
include_directories(${OpenCL_INCLUDE_DIRS})
9-
10-
link_libraries(OpenCL)
11-
125
add_executable(get_device_count_by_type get_device_count_by_type.cpp)
136

147
#Minimum supported version of Intel's OCL GPU and CPU devices

0 commit comments

Comments
 (0)
Please sign in to comment.