@@ -225,12 +225,13 @@ def getGeneralFlags(self, conf):
225
225
['-isystem' , f'{ brewdir } /include' ], # for Homebrew
226
226
['-isystem' , '/opt/local/include' ], # for MacPorts
227
227
]
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' ]
234
235
return flags
235
236
236
237
__cxxFlags = [
@@ -241,11 +242,13 @@ def getGeneralFlags(self, conf):
241
242
def getDebugFlags (self , conf ):
242
243
flags = super ().getDebugFlags (conf )
243
244
flags ['CXXFLAGS' ] += self .__cxxFlags
245
+ ccver = get_compiler_ver (conf )
246
+ darwin = Utils .unversioned_sys_platform () == 'darwin'
244
247
# 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 ) ):
246
249
# https://libcxx.llvm.org/Hardening.html
247
250
flags ['DEFINES' ] += ['_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE' ]
248
- elif get_compiler_ver ( conf ) >= (15 , 0 , 0 ):
251
+ elif ccver >= (15 , 0 , 0 ):
249
252
# https://releases.llvm.org/15.0.0/projects/libcxx/docs/UsingLibcxx.html#enabling-the-safe-libc-mode
250
253
flags ['DEFINES' ] += ['_LIBCPP_ENABLE_ASSERTIONS=1' ]
251
254
# Tell libc++ to avoid including transitive headers
0 commit comments