Update version checks in cmake to match debian stable and remove some workarounds.

This commit is contained in:
Daniel Kirchner 2020-12-07 18:23:45 +01:00
parent 1b88a8c845
commit 2e6693c849
2 changed files with 7 additions and 10 deletions

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.9.0) cmake_minimum_required(VERSION 3.13.0)
set(ETH_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake" CACHE PATH "The the path to the cmake directory") set(ETH_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake" CACHE PATH "The the path to the cmake directory")
list(APPEND CMAKE_MODULE_PATH ${ETH_CMAKE_DIR}) list(APPEND CMAKE_MODULE_PATH ${ETH_CMAKE_DIR})

View File

@ -52,12 +52,9 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
add_compile_options(-Wimplicit-fallthrough) add_compile_options(-Wimplicit-fallthrough)
add_compile_options(-Wsign-conversion) add_compile_options(-Wsign-conversion)
# While this should work on CMake 3.3+, it fails on Ubuntu 18 eth_add_cxx_compiler_flag_if_supported(
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.16) $<$<COMPILE_LANGUAGE:CXX>:-Wextra-semi>
eth_add_cxx_compiler_flag_if_supported( )
$<$<COMPILE_LANGUAGE:CXX>:-Wextra-semi>
)
endif()
# Configuration-specific compiler settings. # Configuration-specific compiler settings.
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -DETH_DEBUG") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -DETH_DEBUG")
@ -68,11 +65,11 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
# Additional GCC-specific compiler settings. # Additional GCC-specific compiler settings.
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
# Check that we've got GCC 5.0 or newer. # Check that we've got GCC 8.0 or newer.
execute_process( execute_process(
COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
if (NOT (GCC_VERSION VERSION_GREATER 5.0 OR GCC_VERSION VERSION_EQUAL 5.0)) if (NOT (GCC_VERSION VERSION_GREATER 8.0 OR GCC_VERSION VERSION_EQUAL 8.0))
message(FATAL_ERROR "${PROJECT_NAME} requires g++ 5.0 or greater.") message(FATAL_ERROR "${PROJECT_NAME} requires g++ 8.0 or greater.")
endif () endif ()
# Use fancy colors in the compiler diagnostics # Use fancy colors in the compiler diagnostics