Set minimum versions for gcc/clang

This commit is contained in:
Mike Ellery
2019-08-13 14:09:21 -07:00
committed by Nik Bougalis
parent 13a4fefe34
commit cbc6e500b6
4 changed files with 8 additions and 25 deletions

View File

@@ -214,11 +214,6 @@ matrix:
- BUILD_TYPE=Debug
- NINJA_BUILD=false
# misc alternative compilers
- compiler: gcc-6
name: gcc-6
env:
- MATRIX_EVAL="CC=gcc-6 && CXX=g++-6"
- BUILD_TYPE=Debug
- compiler: gcc-7
name: gcc-7
env:
@@ -229,11 +224,6 @@ matrix:
env:
- MATRIX_EVAL="CC=gcc-9 && CXX=g++-9"
- BUILD_TYPE=Debug
- compiler: clang-6.0
name: clang-6
env:
- MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0"
- BUILD_TYPE=Debug
- compiler: clang-7
name: clang-7
env:

View File

@@ -61,10 +61,16 @@ endif ()
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES ".*Clang") # both Clang and AppleClang
set (is_clang TRUE)
# TODO enable this version check
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
message (FATAL_ERROR "This project requires clang 5 or later")
endif ()
# TODO min AppleClang version check ?
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set (is_gcc TRUE)
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1)
message (FATAL_ERROR "This project requires GCC 5.1 or later")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
message (FATAL_ERROR "This project requires GCC 7 or later")
endif ()
endif ()
if (CMAKE_GENERATOR STREQUAL "Xcode")

View File

@@ -760,15 +760,6 @@ int main (int argc, char** argv)
ripple::sha512_deprecatedMSVCWorkaround();
#endif
#if defined(__GNUC__) && !defined(__clang__)
auto constexpr gccver = (__GNUC__ * 100 * 100) +
(__GNUC_MINOR__ * 100) +
__GNUC_PATCHLEVEL__;
static_assert (gccver >= 50100,
"GCC version 5.1.0 or later is required to compile rippled.");
#endif
atexit(&google::protobuf::ShutdownProtobufLibrary);
auto const result (ripple::run (argc, argv));

View File

@@ -70,10 +70,6 @@
#ifdef __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wpedantic"
# if __GNUC__ < 5
// GCC 4.9 Bug 61489 Wrong warning with -Wmissing-field-initializers
# pragma GCC diagnostic ignored "-Wmissing-field-initializers"
# endif
#endif
namespace date