_isAppleClang = lambda cfg: '__apple_build_version__' in compilerMacros(cfg)
_isGCC = lambda cfg: '__GNUC__' in compilerMacros(cfg) and '__clang__' not in compilerMacros(cfg)
-def _assert(condition, message):
- """Function to use an assertion statement as an expression.
- Use as `_assert(condition, message) and <expression>`.
- """
- assert condition, message
- return True
-
features = [
Feature(name='fcoroutines-ts', compileFlag='-fcoroutines-ts',
when=lambda cfg: hasCompileFlag(cfg, '-fcoroutines-ts') and
Feature(name=lambda cfg, macro=macro: macro.lower()[1:].replace('_', '-') + (
'={}'.format(compilerMacros(cfg)[macro]) if compilerMacros(cfg)[macro] else ''
),
- when=lambda cfg, macro=macro:
- _assert('_LIBCPP_CONFIG_SITE' in compilerMacros(cfg),
- "Trying to determine whether macro {} is defined, but it looks "
- "like <__config_site> wasn't included".format(macro)) and
- macro in compilerMacros(cfg),
+ when=lambda cfg, macro=macro: macro in compilerMacros(cfg),
# FIXME: This is a hack that should be fixed using module maps.
# If modules are enabled then we have to lift all of the definitions
# in <__config_site> onto the command line.
- compileFlag=lambda cfg: '-Wno-macro-redefined -D{}'.format(macro) + (
+ compileFlag=lambda cfg, macro=macro: '-Wno-macro-redefined -D{}'.format(macro) + (
'={}'.format(compilerMacros(cfg)[macro]) if compilerMacros(cfg)[macro] else ''
)
)