util/Compiler.h: move compiler version checks to meson.build

This commit is contained in:
Max Kellermann 2019-08-02 15:52:35 +02:00
parent b81138bda1
commit e00464435b
2 changed files with 6 additions and 12 deletions

View File

@ -15,6 +15,12 @@ version_cxx = vcs_tag(input: 'src/GitVersion.cxx', output: 'GitVersion.cxx')
compiler = meson.get_compiler('cpp') compiler = meson.get_compiler('cpp')
c_compiler = meson.get_compiler('c') 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 = configuration_data()
conf.set_quoted('PACKAGE', meson.project_name()) conf.set_quoted('PACKAGE', meson.project_name())
conf.set_quoted('PACKAGE_NAME', meson.project_name()) conf.set_quoted('PACKAGE_NAME', meson.project_name())

View File

@ -57,18 +57,6 @@
(GCC_VERSION > 0 && CLANG_VERSION == 0 && \ (GCC_VERSION > 0 && CLANG_VERSION == 0 && \
GCC_VERSION < GCC_MAKE_VERSION(major, minor, 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? * Are we building with the specified version of clang or newer?
*/ */