allow to build Neo with most recent version of Khronos headers

The structure of https://github.com/KhronosGroup/OpenCL-Headers.git has
changed recently and we have to adjust to new layout.
New flow is:
1. try old layout with opencl21 folder in repo, continue compilation
   if successful
2. try with new layout

Change-Id: Ia8c3eb76655aeef70512e9a03d74c72ba776fd4f
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
Artur Harasimiuk
2018-05-17 09:34:27 +02:00
parent 430f6def75
commit 6abcc4a2a9

View File

@ -132,9 +132,18 @@ else()
endif()
message(STATUS "i915 includes dir: ${I915_INCLUDES_DIR}")
if(NOT KHRONOS_HEADERS_DIR)
get_filename_component(KHRONOS_HEADERS_DIR "../khronos/opencl21/" ABSOLUTE)
endif(NOT KHRONOS_HEADERS_DIR)
if(NOT DEFINED KHRONOS_HEADERS_DIR)
get_filename_component(DIR_tmp "../khronos/opencl21/" ABSOLUTE)
if(IS_DIRECTORY ${DIR_tmp})
set(KHRONOS_HEADERS_DIR ${DIR_tmp})
else()
get_filename_component(DIR_tmp "../khronos/" ABSOLUTE)
if(IS_DIRECTORY ${DIR_tmp})
set(KHRONOS_HEADERS_DIR ${DIR_tmp})
add_definitions(-DCL_TARGET_OPENCL_VERSION=210)
endif()
endif()
endif()
message(STATUS "Khronos OpenCL headers dir: ${KHRONOS_HEADERS_DIR}")
set(OCL_HEADERS_DIR ${KHRONOS_HEADERS_DIR})