Cross platform solution to linking OpenCLVectorAdd libraries

This commit is contained in:
Dantali0n 2022-01-20 12:42:51 +01:00
parent bff83aab4a
commit 1120f0b07e

View File

@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.0)
project(OpenCLVectorAdd)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
find_package(OpenCL REQUIRED)
add_executable(OpenCLVectorAdd OpenCLVectorAdd.cpp)
@ -11,4 +14,4 @@ add_library(TracyClient STATIC ../../TracyClient.cpp
target_include_directories(TracyClient PUBLIC ../../)
target_compile_definitions(TracyClient PUBLIC TRACY_ENABLE=1)
target_link_libraries(OpenCLVectorAdd PUBLIC OpenCL::OpenCL TracyClient dl pthread)
target_link_libraries(OpenCLVectorAdd PUBLIC OpenCL::OpenCL TracyClient ${CMAKE_DL_LIBS} Threads::Threads)