From e00464435bb80697f0fba06417a40275c9944dce Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 2 Aug 2019 15:52:35 +0200 Subject: [PATCH] util/Compiler.h: move compiler version checks to meson.build --- meson.build | 6 ++++++ src/util/Compiler.h | 12 ------------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/meson.build b/meson.build index dd4bef90d..6d35c5990 100644 --- a/meson.build +++ b/meson.build @@ -15,6 +15,12 @@ version_cxx = vcs_tag(input: 'src/GitVersion.cxx', output: 'GitVersion.cxx') compiler = meson.get_compiler('cpp') c_compiler = meson.get_compiler('c') +if compiler.get_id() == 'gcc' and compiler.version().version_compare('<6') + warning('Your GCC version is too old. You need at least version 6.') +elif compiler.get_id() == 'clang' and compiler.version().version_compare('<3') + warning('Your clang version is too old. You need at least version 3.') +endif + conf = configuration_data() conf.set_quoted('PACKAGE', meson.project_name()) conf.set_quoted('PACKAGE_NAME', meson.project_name()) diff --git a/src/util/Compiler.h b/src/util/Compiler.h index 60f7fe678..6a64ad098 100644 --- a/src/util/Compiler.h +++ b/src/util/Compiler.h @@ -57,18 +57,6 @@ (GCC_VERSION > 0 && CLANG_VERSION == 0 && \ GCC_VERSION < GCC_MAKE_VERSION(major, minor, 0)) -#ifdef __clang__ -# if __clang_major__ < 3 -# error Sorry, your clang version is too old. You need at least version 3.1. -# endif -#elif defined(__GNUC__) -# if GCC_OLDER_THAN(6,0) -# error Sorry, your gcc version is too old. You need at least version 6.0. -# endif -#else -# warning Untested compiler. Use at your own risk! -#endif - /** * Are we building with the specified version of clang or newer? */