CMake: Fix for QT 5.7 overwriting -std=c++1y flag

In QT 5.7 they added a new check for CXX features which appends a minimum
required standard to the CXX_FLAGS. Because we were writing the flag
directly previously, cmake assumed it needed to add a c++11 flag to the
build. This tells cmake to use c++14 on every build.
This commit is contained in:
James Rowe 2016-06-30 11:59:32 -06:00
parent e91327c86a
commit a976c2e3ba
2 changed files with 8 additions and 6 deletions

View file

@ -1,6 +1,5 @@
# CMake 3.1 required for Qt5 settings to be applied automatically on
# dependent libraries and IMPORTED targets.
cmake_minimum_required(VERSION 3.1)
# CMake 3.2 required for cmake to know the right flags for CXX standard on OSX
cmake_minimum_required(VERSION 3.2)
function(download_bundled_external remote_path lib_name prefix_var)
set(prefix "${CMAKE_BINARY_DIR}/externals/${lib_name}")
@ -63,8 +62,11 @@ if (NOT DEFINED ARCHITECTURE)
endif()
message(STATUS "Target architecture: ${ARCHITECTURE}")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if (NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -Wno-attributes")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
else()
# Silence "deprecation" warnings