mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-23 00:02:38 -05:00
Use opencl.hpp header instead of cl2.hpp if present
Avoids a "cl2.hpp has been renamed to opencl.hpp" warning being spammed out on newer opencl environments
This commit is contained in:
parent
383065d27f
commit
8f8c90897a
@ -19,7 +19,7 @@ if (OPENCL_HPP_INCLUDE_DIR)
|
||||
SET(OPENCL_HPP_FOUND TRUE)
|
||||
else ()
|
||||
find_path(OPENCL_HPP_INCLUDE_DIR
|
||||
NAMES CL/cl2.hpp
|
||||
NAMES CL/opencl.hpp CL/cl2.hpp
|
||||
PATHS
|
||||
${LIB_DIR}/include
|
||||
"$ENV{LIB_DIR}/include"
|
||||
@ -36,6 +36,19 @@ endif ()
|
||||
|
||||
|
||||
if (OPENCL_HPP_FOUND)
|
||||
# see if newer opencl.hpp file exists in include dir -- if so we should use this
|
||||
# instead of the deprecated cl2.hpp header
|
||||
find_path(OPENCL_HPP_RENAMED_PATH
|
||||
NAMES CL/opencl.hpp
|
||||
PATHS
|
||||
${OPENCL_HPP_INCLUDE_DIR}
|
||||
)
|
||||
if (OPENCL_HPP_RENAMED_PATH)
|
||||
SET(OPENCL_USE_NEW_HEADER TRUE)
|
||||
else ()
|
||||
SET(OPENCL_USE_NEW_HEADER FALSE)
|
||||
endif ()
|
||||
|
||||
if (NOT OPENCLHPP_FIND_QUIETLY)
|
||||
message(STATUS "Found OpenCL C++ headers: ${OPENCL_HPP_INCLUDE_DIR}")
|
||||
endif ()
|
||||
|
@ -70,6 +70,7 @@
|
||||
#cmakedefine HAVE_SERVER_PYTHON_PLUGINS
|
||||
|
||||
#cmakedefine HAVE_OPENCL
|
||||
#cmakedefine OPENCL_USE_NEW_HEADER
|
||||
|
||||
#cmakedefine ENABLE_MODELTEST
|
||||
|
||||
|
@ -31,7 +31,13 @@
|
||||
#define CL_TARGET_OPENCL_VERSION 200
|
||||
#endif
|
||||
|
||||
#include "qgsconfig.h"
|
||||
|
||||
#ifdef OPENCL_USE_NEW_HEADER
|
||||
#include <CL/opencl.hpp>
|
||||
#else
|
||||
#include <CL/cl2.hpp>
|
||||
#endif
|
||||
|
||||
#include "qgis_core.h"
|
||||
#include "qgis.h"
|
||||
|
Loading…
x
Reference in New Issue
Block a user