mirror of https://gitlab.com/ita1024/waf.git
Ignore error codes from cmd_and_log in getoutput that is used to obtain
the version string of Fortran compilers. Some compilers will fail and return an error code if not provided with a source file, yet they print the desired version string. Thus, in case of an error code we ignore it here and just pass on the stdout and stderr of the called subprocess.
This commit is contained in:
parent
6132c8e055
commit
2262f1009b
|
@ -336,6 +336,7 @@ def getoutput(conf, cmd, stdin=False):
|
|||
TODO a bit redundant, can be removed anytime
|
||||
TODO waf 1.9
|
||||
"""
|
||||
from waflib import Errors
|
||||
if conf.env.env:
|
||||
env = conf.env.env
|
||||
else:
|
||||
|
@ -344,6 +345,12 @@ def getoutput(conf, cmd, stdin=False):
|
|||
input = stdin and '\n'.encode() or None
|
||||
try:
|
||||
out, err = conf.cmd_and_log(cmd, env=env, output=0, input=input)
|
||||
except Errors.WafError as e:
|
||||
# Some compilers will return an error code if no source file
|
||||
# is provided. Nevertheless, they print a version string and
|
||||
# we can ignore the error code here.
|
||||
out = e.stdout
|
||||
err = e.stderr
|
||||
except Exception:
|
||||
conf.fatal('could not determine the compiler version %r' % cmd)
|
||||
return (out, err)
|
||||
|
|
Loading…
Reference in New Issue