@@ -225,12 +225,13 @@ def getGeneralFlags(self, conf):
225225 ['-isystem' , f'{ brewdir } /include' ], # for Homebrew
226226 ['-isystem' , '/opt/local/include' ], # for MacPorts
227227 ]
228- elif Utils .unversioned_sys_platform () == 'freebsd' :
229- # Bug #4790
230- flags ['CXXFLAGS' ] += [['-isystem' , '/usr/local/include' ]]
231- if get_compiler_ver (conf ) >= (18 , 0 , 0 ) and get_compiler_ver (conf ) < (20 , 1 , 0 ):
232- # Bug #5300
233- flags ['CXXFLAGS' ] += ['-Wno-enum-constexpr-conversion' ]
228+ else :
229+ if Utils .unversioned_sys_platform () == 'freebsd' :
230+ # Bug #4790
231+ flags ['CXXFLAGS' ] += [['-isystem' , '/usr/local/include' ]]
232+ if get_compiler_ver (conf ) >= (18 , 0 , 0 ) and get_compiler_ver (conf ) < (20 , 1 , 0 ):
233+ # Bug #5300
234+ flags ['CXXFLAGS' ] += ['-Wno-enum-constexpr-conversion' ]
234235 return flags
235236
236237 __cxxFlags = [
@@ -241,11 +242,13 @@ def getGeneralFlags(self, conf):
241242 def getDebugFlags (self , conf ):
242243 flags = super ().getDebugFlags (conf )
243244 flags ['CXXFLAGS' ] += self .__cxxFlags
245+ ccver = get_compiler_ver (conf )
246+ darwin = Utils .unversioned_sys_platform () == 'darwin'
244247 # Enable assertions in libc++
245- if get_compiler_ver ( conf ) >= (18 , 0 , 0 ):
248+ if ( darwin and ccver >= ( 17 , 0 , 0 )) or ( not darwin and ccver >= (18 , 0 , 0 ) ):
246249 # https://libcxx.llvm.org/Hardening.html
247250 flags ['DEFINES' ] += ['_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE' ]
248- elif get_compiler_ver ( conf ) >= (15 , 0 , 0 ):
251+ elif ccver >= (15 , 0 , 0 ):
249252 # https://releases.llvm.org/15.0.0/projects/libcxx/docs/UsingLibcxx.html#enabling-the-safe-libc-mode
250253 flags ['DEFINES' ] += ['_LIBCPP_ENABLE_ASSERTIONS=1' ]
251254 # Tell libc++ to avoid including transitive headers
0 commit comments