fwgslib: check flags in parallel. Remove prebuilt waf
This commit is contained in:
parent
e12bfc5112
commit
40bbcdf889
|
@ -48,30 +48,27 @@ def get_flags_by_type(flags, type, compiler):
|
||||||
return out
|
return out
|
||||||
|
|
||||||
@Configure.conf
|
@Configure.conf
|
||||||
def filter_flags(conf, flags, required_flags, checkfunc, checkarg, compiler):
|
def filter_flags(conf, flags, required_flags, features, checkarg, compiler):
|
||||||
conf.msg('Detecting supported flags for %s' % (compiler), '...')
|
|
||||||
|
|
||||||
check_flags = required_flags + (['-Werror'] if compiler != 'msvc' else [])
|
check_flags = required_flags + (['-Werror'] if compiler != 'msvc' else [])
|
||||||
supported_flags = []
|
tests = map(lambda x: {
|
||||||
|
'features': features,
|
||||||
for f in flags:
|
'compiler' : compiler,
|
||||||
conf.start_msg('Checking for %s' % f)
|
'msg': '... ' + x,
|
||||||
|
'define_name': Utils.quote_define_name(x),
|
||||||
fun = getattr(conf, 'check_' + checkfunc)
|
checkarg: [x] + check_flags }, flags )
|
||||||
|
|
||||||
try:
|
|
||||||
fun(conf, **{ checkarg: [f] + check_flags })
|
|
||||||
except conf.errors.ConfigurationError:
|
|
||||||
conf.end_msg('no', color='YELLOW')
|
|
||||||
else:
|
|
||||||
conf.end_msg('yes')
|
|
||||||
supported_flags.append(f)
|
|
||||||
|
|
||||||
|
conf.env.stash()
|
||||||
|
conf.multicheck(*tests,
|
||||||
|
msg = 'Checking supported flags for %s in parallel' % compiler,
|
||||||
|
mandatory = False)
|
||||||
|
supported_flags = [ f for f in flags if conf.env[Utils.quote_define_name(f)] ]
|
||||||
|
conf.env.revert()
|
||||||
return supported_flags
|
return supported_flags
|
||||||
|
|
||||||
@Configure.conf
|
@Configure.conf
|
||||||
def filter_cflags(conf, flags, required_flags = []):
|
def filter_cflags(conf, flags, required_flags = []):
|
||||||
return conf.filter_flags(flags, required_flags, 'cc', 'cflags', conf.env.COMPILER_CC)
|
return conf.filter_flags(flags, required_flags, 'c', 'cflags', conf.env.COMPILER_CC)
|
||||||
|
|
||||||
@Configure.conf
|
@Configure.conf
|
||||||
def filter_cxxflags(conf, flags, required_flags = []):
|
def filter_cxxflags(conf, flags, required_flags = []):
|
||||||
|
|
Loading…
Reference in New Issue