From 1fb29ce97da05f7f3929b18f384634bc60020e10 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 21 Mar 2024 11:58:30 +0000 Subject: [PATCH] Explicitly build with C++14 everywhere * This doesn't change our minimum specs as we already required GCC 5, clang 3.4, which fully support C++14. Interestingly only VS2015 is the odd one out but we don't rely on any features from C++14 that it doesn't support. --- CMakeLists.txt | 10 +++++++++- qrenderdoc/Code/pyrenderdoc/CMakeLists.txt | 8 -------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09eb367a7..4bd7939cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -386,8 +386,16 @@ if(STRIP_ANDROID_LIBRARY AND BUILD_ANDROID AND RELEASE_MODE) message(STATUS "libraries will be stripped with ${ANDROID_STRIP_TOOL}") endif() +# Build as C++14 +if (CMAKE_VERSION VERSION_LESS "3.1") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") +else () + set (CMAKE_CXX_STANDARD 14) + set (CMAKE_CXX_STANDARD_REQUIRED ON) +endif () + if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-strict-aliasing") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") if(ENABLE_GGP) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gline-tables-only -fno-omit-frame-pointer") diff --git a/qrenderdoc/Code/pyrenderdoc/CMakeLists.txt b/qrenderdoc/Code/pyrenderdoc/CMakeLists.txt index 6c7f49640..749358c2f 100644 --- a/qrenderdoc/Code/pyrenderdoc/CMakeLists.txt +++ b/qrenderdoc/Code/pyrenderdoc/CMakeLists.txt @@ -1,11 +1,3 @@ -# Build as C++14 for the python bindings template-fu -if (CMAKE_VERSION VERSION_LESS "3.1") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") -else () - set (CMAKE_CXX_STANDARD 14) - set (CMAKE_CXX_STANDARD_REQUIRED ON) -endif () - # include paths for qrenderdoc, the internal renderdoc API, and Python set(MODULE_INCLUDES PRIVATE ${CMAKE_SOURCE_DIR}/qrenderdoc