From fc4afbd0f96d50d84af0d8750604e8f0e7021d28 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Fri, 17 Apr 2020 20:09:26 -0400 Subject: [PATCH] Use cmake features to set C++ version Change-Id: Icf5dcd781b8fecc7a39117f3c6dee97dcba9dcca --- opencl/amdocl/CMakeLists.txt | 5 ++++- opencl/tools/clinfo/CMakeLists.txt | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/opencl/amdocl/CMakeLists.txt b/opencl/amdocl/CMakeLists.txt index 371039e50b..9aa8b083d1 100644 --- a/opencl/amdocl/CMakeLists.txt +++ b/opencl/amdocl/CMakeLists.txt @@ -1,5 +1,8 @@ -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC") +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) # Some linker flags, -Wl,--unresolved-symbols=report-all being one of them, requires -shared-libasan if using -fsanitize=address. # If -Wl,--unresolved-symbols=report-all is removed from CMAKE_SHARED_LINKER_FLAGS, then update this snippet diff --git a/opencl/tools/clinfo/CMakeLists.txt b/opencl/tools/clinfo/CMakeLists.txt index 4e7f08c3a8..f7c953fd3b 100644 --- a/opencl/tools/clinfo/CMakeLists.txt +++ b/opencl/tools/clinfo/CMakeLists.txt @@ -1,4 +1,7 @@ -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)