build+ci: sync with ndn-cxx
Change-Id: Iff3ad63469eccb47571ba4abd3d42936f0cd8650
diff --git a/.waf-tools/default-compiler-flags.py b/.waf-tools/default-compiler-flags.py
index 681913f..c8ab164 100644
--- a/.waf-tools/default-compiler-flags.py
+++ b/.waf-tools/default-compiler-flags.py
@@ -11,29 +11,32 @@
conf.start_msg('Checking C++ compiler version')
cxx = conf.env.CXX_NAME # generic name of the compiler
- ccver = tuple(int(i) for i in conf.env.CC_VERSION)
+ ccver = get_compiler_ver(conf)
ccverstr = '.'.join(conf.env.CC_VERSION)
errmsg = ''
warnmsg = ''
if cxx == 'gcc':
- if ccver < (7, 4, 0):
+ if ccver < (9, 1, 0):
errmsg = ('The version of gcc you are using is too old.\n'
- 'The minimum supported gcc version is 9.3.')
- elif ccver < (9, 3, 0):
- warnmsg = ('Using a version of gcc older than 9.3 is not '
+ 'The minimum supported gcc version is 10.2.')
+ elif ccver < (10, 2, 0):
+ warnmsg = ('Using a version of gcc older than 10.2 is not '
'officially supported and may result in build failures.')
conf.flags = GccFlags()
elif cxx == 'clang':
if Utils.unversioned_sys_platform() == 'darwin':
- if ccver < (10, 0, 0):
+ if ccver < (11, 0, 0):
errmsg = ('The version of Xcode you are using is too old.\n'
- 'The minimum supported Xcode version is 12.4.')
- elif ccver < (12, 0, 0):
- warnmsg = ('Using a version of Xcode older than 12.4 is not '
+ 'The minimum supported Xcode version is 13.0.')
+ elif ccver < (13, 0, 0):
+ warnmsg = ('Using a version of Xcode older than 13.0 is not '
'officially supported and may result in build failures.')
elif ccver < (7, 0, 0):
errmsg = ('The version of clang you are using is too old.\n'
- 'The minimum supported clang version is 7.0.')
+ 'The minimum supported clang version is 10.0.')
+ elif ccver < (10, 0, 0):
+ warnmsg = ('Using a version of clang older than 10.0 is not '
+ 'officially supported and may result in build failures.')
conf.flags = ClangFlags()
else:
warnmsg = f'{cxx} compiler is unsupported'
@@ -57,6 +60,10 @@
conf.env.DEFINES += generalFlags['DEFINES']
+def get_compiler_ver(conf):
+ return tuple(int(i) for i in conf.env.CC_VERSION)
+
+
@Configure.conf
def check_compiler_flags(conf):
# Debug or optimized CXXFLAGS and LINKFLAGS are applied only if the
@@ -121,9 +128,6 @@
class CompilerFlags:
- def getCompilerVersion(self, conf):
- return tuple(int(i) for i in conf.env.CC_VERSION)
-
def getGeneralFlags(self, conf):
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are always needed"""
return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': []}
@@ -223,7 +227,7 @@
elif Utils.unversioned_sys_platform() == 'freebsd':
# Bug #4790
flags['CXXFLAGS'] += [['-isystem', '/usr/local/include']]
- if self.getCompilerVersion(conf) >= (18, 0, 0):
+ if get_compiler_ver(conf) >= (18, 0, 0) and get_compiler_ver(conf) < (20, 1, 0):
# Bug #5300
flags['CXXFLAGS'] += ['-Wno-enum-constexpr-conversion']
return flags
@@ -237,10 +241,10 @@
flags = super().getDebugFlags(conf)
flags['CXXFLAGS'] += self.__cxxFlags
# Enable assertions in libc++
- if self.getCompilerVersion(conf) >= (18, 0, 0):
+ if get_compiler_ver(conf) >= (18, 0, 0):
# https://libcxx.llvm.org/Hardening.html
flags['DEFINES'] += ['_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE']
- elif self.getCompilerVersion(conf) >= (15, 0, 0):
+ elif get_compiler_ver(conf) >= (15, 0, 0):
# https://releases.llvm.org/15.0.0/projects/libcxx/docs/UsingLibcxx.html#enabling-the-safe-libc-mode
flags['DEFINES'] += ['_LIBCPP_ENABLE_ASSERTIONS=1']
# Tell libc++ to avoid including transitive headers