@@ -11,29 +11,32 @@ def configure(conf):
1111 conf .start_msg ('Checking C++ compiler version' )
1212
1313 cxx = conf .env .CXX_NAME # generic name of the compiler
14- ccver = tuple ( int ( i ) for i in conf . env . CC_VERSION )
14+ ccver = get_compiler_ver ( conf )
1515 ccverstr = '.' .join (conf .env .CC_VERSION )
1616 errmsg = ''
1717 warnmsg = ''
1818 if cxx == 'gcc' :
19- if ccver < (7 , 4 , 0 ):
19+ if ccver < (9 , 1 , 0 ):
2020 errmsg = ('The version of gcc you are using is too old.\n '
21- 'The minimum supported gcc version is 9.3 .' )
22- elif ccver < (9 , 3 , 0 ):
23- warnmsg = ('Using a version of gcc older than 9.3 is not '
21+ 'The minimum supported gcc version is 10.2 .' )
22+ elif ccver < (10 , 2 , 0 ):
23+ warnmsg = ('Using a version of gcc older than 10.2 is not '
2424 'officially supported and may result in build failures.' )
2525 conf .flags = GccFlags ()
2626 elif cxx == 'clang' :
2727 if Utils .unversioned_sys_platform () == 'darwin' :
28- if ccver < (10 , 0 , 0 ):
28+ if ccver < (11 , 0 , 0 ):
2929 errmsg = ('The version of Xcode you are using is too old.\n '
30- 'The minimum supported Xcode version is 12.4 .' )
31- elif ccver < (12 , 0 , 0 ):
32- warnmsg = ('Using a version of Xcode older than 12.4 is not '
30+ 'The minimum supported Xcode version is 13.0 .' )
31+ elif ccver < (13 , 0 , 0 ):
32+ warnmsg = ('Using a version of Xcode older than 13.0 is not '
3333 'officially supported and may result in build failures.' )
3434 elif ccver < (7 , 0 , 0 ):
3535 errmsg = ('The version of clang you are using is too old.\n '
36- 'The minimum supported clang version is 7.0.' )
36+ 'The minimum supported clang version is 10.0.' )
37+ elif ccver < (10 , 0 , 0 ):
38+ warnmsg = ('Using a version of clang older than 10.0 is not '
39+ 'officially supported and may result in build failures.' )
3740 conf .flags = ClangFlags ()
3841 else :
3942 warnmsg = f'{ cxx } compiler is unsupported'
@@ -57,6 +60,10 @@ def configure(conf):
5760 conf .env .DEFINES += generalFlags ['DEFINES' ]
5861
5962
63+ def get_compiler_ver (conf ):
64+ return tuple (int (i ) for i in conf .env .CC_VERSION )
65+
66+
6067@Configure .conf
6168def check_compiler_flags (conf ):
6269 # Debug or optimized CXXFLAGS and LINKFLAGS are applied only if the
@@ -121,9 +128,6 @@ def add_supported_linkflags(self, linkflags):
121128
122129
123130class CompilerFlags :
124- def getCompilerVersion (self , conf ):
125- return tuple (int (i ) for i in conf .env .CC_VERSION )
126-
127131 def getGeneralFlags (self , conf ):
128132 """Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are always needed"""
129133 return {'CXXFLAGS' : [], 'LINKFLAGS' : [], 'DEFINES' : []}
@@ -223,7 +227,7 @@ def getGeneralFlags(self, conf):
223227 elif Utils .unversioned_sys_platform () == 'freebsd' :
224228 # Bug #4790
225229 flags ['CXXFLAGS' ] += [['-isystem' , '/usr/local/include' ]]
226- if self . getCompilerVersion (conf ) >= (18 , 0 , 0 ):
230+ if get_compiler_ver (conf ) >= (18 , 0 , 0 ) and get_compiler_ver ( conf ) < ( 20 , 1 , 0 ):
227231 # Bug #5300
228232 flags ['CXXFLAGS' ] += ['-Wno-enum-constexpr-conversion' ]
229233 return flags
@@ -237,10 +241,10 @@ def getDebugFlags(self, conf):
237241 flags = super ().getDebugFlags (conf )
238242 flags ['CXXFLAGS' ] += self .__cxxFlags
239243 # Enable assertions in libc++
240- if self . getCompilerVersion (conf ) >= (18 , 0 , 0 ):
244+ if get_compiler_ver (conf ) >= (18 , 0 , 0 ):
241245 # https://libcxx.llvm.org/Hardening.html
242246 flags ['DEFINES' ] += ['_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE' ]
243- elif self . getCompilerVersion (conf ) >= (15 , 0 , 0 ):
247+ elif get_compiler_ver (conf ) >= (15 , 0 , 0 ):
244248 # https://releases.llvm.org/15.0.0/projects/libcxx/docs/UsingLibcxx.html#enabling-the-safe-libc-mode
245249 flags ['DEFINES' ] += ['_LIBCPP_ENABLE_ASSERTIONS=1' ]
246250 # Tell libc++ to avoid including transitive headers
0 commit comments