set (OPENCL_ICD_LOADER_SOURCES icd.c icd_dispatch.c)
-if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
- list (APPEND OPENCL_ICD_LOADER_SOURCES icd_linux.c icd_exports.map)
-else ()
+if (WIN32)
list (APPEND OPENCL_ICD_LOADER_SOURCES icd_windows.c icd_windows_hkr.c OpenCL.def OpenCL.rc)
include_directories ($ENV{DXSDK_DIR}/Include)
+else ()
+ list (APPEND OPENCL_ICD_LOADER_SOURCES icd_linux.c icd_exports.map)
endif ()
# Change this to point to a directory containing OpenCL header directory "CL"
add_library (OpenCL SHARED ${OPENCL_ICD_LOADER_SOURCES})
set_target_properties (OpenCL PROPERTIES VERSION "1.2" SOVERSION "1")
-if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
- set_target_properties (OpenCL PROPERTIES LINK_FLAGS "-pthread -Wl,--version-script -Wl,${CMAKE_CURRENT_SOURCE_DIR}/icd_exports.map")
-else()
+if (WIN32)
target_link_libraries (OpenCL cfgmgr32.lib)
+else()
+ if (APPLE)
+ set_target_properties (OpenCL PROPERTIES LINK_FLAGS "-pthread")
+ else ()
+ set_target_properties (OpenCL PROPERTIES LINK_FLAGS "-pthread -Wl,--version-script -Wl,${CMAKE_CURRENT_SOURCE_DIR}/icd_exports.map")
+ endif ()
endif ()
target_link_libraries (OpenCL ${CMAKE_DL_LIBS})