Skip to content

Commit

Permalink
[SYCL] Fix linking with renamed OpenCL library.
Browse files Browse the repository at this point in the history
This change allows configuring OpenCL library name via OpenCL_LIBRARY
CMake variable.

Signed-off-by: Alexey Bader <alexey.bader@intel.com>
  • Loading branch information
bader committed Feb 27, 2019
1 parent 9fa2654 commit ba999d3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
3 changes: 1 addition & 2 deletions sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ set ( LLVM_INST_INC_DIRECTORY "lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/i
find_package(OpenCL REQUIRED)

include_directories(${OpenCL_INCLUDE_DIRS})
link_libraries(OpenCL)
link_libraries(${OpenCL_LIBRARY})

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

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

target_link_libraries("${SYCLLibrary}" "${OpenCL_LIBRARIES}")
set_target_properties("${SYCLLibrary}" PROPERTIES LINKER_LANGUAGE CXX)

# Workaround for bug in GCC version 5.
Expand Down
7 changes: 0 additions & 7 deletions sycl/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

find_package(OpenCL REQUIRED)

# All projects need this include directory
include_directories(${OpenCL_INCLUDE_DIRS})

link_libraries(OpenCL)

add_executable(get_device_count_by_type get_device_count_by_type.cpp)

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

0 comments on commit ba999d3

Please sign in to comment.