Cleanup: bump CMake requirement, so we have better C++14 build support

This commit is contained in:
Adriaan de Groot 2017-06-12 05:23:34 -04:00 committed by Philip
parent 33040dbec0
commit 9b2778eecc
2 changed files with 11 additions and 7 deletions

View File

@ -3,19 +3,24 @@ project( calamares CXX )
# The partition manager uses ECM but ECMConfig.cmake # The partition manager uses ECM but ECMConfig.cmake
# will complain if we require CMake less than 2.8.13, # will complain if we require CMake less than 2.8.13,
# so never change this. # so never change this.
cmake_minimum_required( VERSION 2.8.12 ) cmake_minimum_required( VERSION 3.2 )
set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" ) set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" )
set( CMAKE_CXX_STANDARD 14 )
set( CMAKE_CXX_STANDARD_REQUIRED ON )
set( CMAKE_C_STANDARD 99 )
set( CMAKE_C_STANDARD_REQUIRED ON )
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
message( STATUS "Found Clang ${CMAKE_CXX_COMPILER_VERSION}, setting up Clang-specific compiler flags." ) message( STATUS "Found Clang ${CMAKE_CXX_COMPILER_VERSION}, setting up Clang-specific compiler flags." )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=c99" ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall" )
set( CMAKE_C_FLAGS_DEBUG "-g" ) set( CMAKE_C_FLAGS_DEBUG "-g" )
set( CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG" ) set( CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG" )
set( CMAKE_C_FLAGS_RELEASE "-O4 -DNDEBUG" ) set( CMAKE_C_FLAGS_RELEASE "-O4 -DNDEBUG" )
set( CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g" ) set( CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything -std=c++14" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything" )
set( CMAKE_CXX_FLAGS_DEBUG "-g" ) set( CMAKE_CXX_FLAGS_DEBUG "-g" )
set( CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG" ) set( CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG" )
set( CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG" ) set( CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG" )
@ -25,9 +30,8 @@ if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" ) set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
else() else()
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-undefined" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wl,--no-undefined" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--fatal-warnings -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wl,--fatal-warnings -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type" )
endif() endif()
if( CMAKE_COMPILER_IS_GNUCXX ) if( CMAKE_COMPILER_IS_GNUCXX )

View File

@ -13,7 +13,7 @@
Main: Main:
* Compiler with C++11 support: GCC >= 4.9.0 or Clang >= 3.5.1 * Compiler with C++11 support: GCC >= 4.9.0 or Clang >= 3.5.1
* CMake >= 2.8.12 * CMake >= 3.2
* Qt >= 5.6 * Qt >= 5.6
* yaml-cpp >= 0.5.1 * yaml-cpp >= 0.5.1
* Python >= 3.3 * Python >= 3.3