fix compilation with clang 10

Add flag -Wno-deprecated-copy only for clang >= 10.0

Signed-off-by: Jacek Danecki <jacek.danecki@intel.com>

https://github.com/intel/compute-runtime/pull/289

Change-Id: I40cbc40a245f82a5dc9798851a276ead9e9ab74b
This commit is contained in:
Jacek Danecki
2020-04-01 12:21:48 +02:00
committed by sys_ocldev
parent c6cd582f78
commit 41e18a9616
2 changed files with 4 additions and 1 deletions

View File

@ -747,6 +747,9 @@ if(NOT MSVC)
if (NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-register") # Added for htons()
endif()
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-copy")
endif()
else()
# gcc only
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs -Wno-unused-but-set-variable")

View File

@ -81,7 +81,7 @@ cl_int Program::compile(
options = (buildOptions != nullptr) ? buildOptions : "";
for (const auto optionString : {CompilerOptions::gtpinRera, CompilerOptions::greaterThan4gbBuffersRequired}) {
for (const auto &optionString : {CompilerOptions::gtpinRera, CompilerOptions::greaterThan4gbBuffersRequired}) {
size_t pos = options.find(optionString);
if (pos != std::string::npos) {
options.erase(pos, optionString.length());