From 9b2778eecc9c7771bdc5d868f22fad88e0ede8e2 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 12 Jun 2017 05:23:34 -0400 Subject: [PATCH] Cleanup: bump CMake requirement, so we have better C++14 build support --- CMakeLists.txt | 16 ++++++++++------ README.md | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 128e9e3c1..d656ba537 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,19 +3,24 @@ project( calamares CXX ) # The partition manager uses ECM but ECMConfig.cmake # will complain if we require CMake less than 2.8.13, # 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_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" ) 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_MINSIZEREL "-Os -DNDEBUG" ) set( CMAKE_C_FLAGS_RELEASE "-O4 -DNDEBUG" ) 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_MINSIZEREL "-Os -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" ) else() - set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99" ) - set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wl,--no-undefined" ) - set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wl,--fatal-warnings -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type" ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-undefined" ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--fatal-warnings -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type" ) endif() if( CMAKE_COMPILER_IS_GNUCXX ) diff --git a/README.md b/README.md index 29ebce73f..49bb4c4b4 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Main: * Compiler with C++11 support: GCC >= 4.9.0 or Clang >= 3.5.1 -* CMake >= 2.8.12 +* CMake >= 3.2 * Qt >= 5.6 * yaml-cpp >= 0.5.1 * Python >= 3.3