@@ -224,12 +224,13 @@ def getGeneralFlags(self, conf):
224224 ['-isystem' , f'{ brewdir } /include' ], # for Homebrew
225225 ['-isystem' , '/opt/local/include' ], # for MacPorts
226226 ]
227- elif Utils .unversioned_sys_platform () == 'freebsd' :
228- # Bug #4790
229- flags ['CXXFLAGS' ] += [['-isystem' , '/usr/local/include' ]]
230- if get_compiler_ver (conf ) >= (18 , 0 , 0 ) and get_compiler_ver (conf ) < (20 , 1 , 0 ):
231- # Bug #5300
232- flags ['CXXFLAGS' ] += ['-Wno-enum-constexpr-conversion' ]
227+ else :
228+ if 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' ]
233234 return flags
234235
235236 __cxxFlags = [
@@ -240,11 +241,13 @@ def getGeneralFlags(self, conf):
240241 def getDebugFlags (self , conf ):
241242 flags = super ().getDebugFlags (conf )
242243 flags ['CXXFLAGS' ] += self .__cxxFlags
244+ ccver = get_compiler_ver (conf )
245+ darwin = Utils .unversioned_sys_platform () == 'darwin'
243246 # Enable assertions in libc++
244- if get_compiler_ver ( conf ) >= (18 , 0 , 0 ):
247+ if ( darwin and ccver >= ( 17 , 0 , 0 )) or ( not darwin and ccver >= (18 , 0 , 0 ) ):
245248 # https://libcxx.llvm.org/Hardening.html
246249 flags ['DEFINES' ] += ['_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE' ]
247- elif get_compiler_ver ( conf ) >= (15 , 0 , 0 ):
250+ elif ccver >= (15 , 0 , 0 ):
248251 # https://releases.llvm.org/15.0.0/projects/libcxx/docs/UsingLibcxx.html#enabling-the-safe-libc-mode
249252 flags ['DEFINES' ] += ['_LIBCPP_ENABLE_ASSERTIONS=1' ]
250253 # Tell libc++ to avoid including transitive headers
0 commit comments