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