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.
This commit is contained in:
baldurk
2024-03-21 11:58:30 +00:00
parent 922ef9814f
commit 1fb29ce97d
2 changed files with 9 additions and 9 deletions
+9 -1
View File
@@ -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")
@@ -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