Try to be locale-independent when we match VS output
Different locales have a different number of ':' in the string we want to match. Closes #1639.
This commit is contained in:
parent
d542b2c0cc
commit
83c5c738dd
|
@ -83,3 +83,4 @@ Rafael Fontenelle
|
||||||
Michael Olbrich
|
Michael Olbrich
|
||||||
Ernestas Kulik
|
Ernestas Kulik
|
||||||
Thomas Hindoe Paaboel Andersen
|
Thomas Hindoe Paaboel Andersen
|
||||||
|
Paolo Borelli
|
||||||
|
|
|
@ -175,11 +175,16 @@ int dummy;
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
(stdo, _) = pc.communicate()
|
(stdo, _) = pc.communicate()
|
||||||
|
|
||||||
|
# We want to match 'Note: including file: ' in the line
|
||||||
|
# 'Note: including file: d:\MyDir\include\stdio.h', however
|
||||||
|
# different locales have different messages with a different
|
||||||
|
# number of colons. Match up to the the drive name 'd:\'.
|
||||||
|
matchre = re.compile(rb"^(.*\s)[a-zA-Z]:\\.*stdio.h$")
|
||||||
for line in stdo.split(b'\r\n'):
|
for line in stdo.split(b'\r\n'):
|
||||||
if line.endswith(b'stdio.h'):
|
match = matchre.match(line)
|
||||||
matchstr = b':'.join(line.split(b':')[0:2]) + b':'
|
if match:
|
||||||
with open(tempfilename, 'ab') as binfile:
|
with open(tempfilename, 'ab') as binfile:
|
||||||
binfile.write(b'msvc_deps_prefix = ' + matchstr + b'\n')
|
binfile.write(b'msvc_deps_prefix = ' + match.group(1) + b'\n')
|
||||||
return open(tempfilename, 'a')
|
return open(tempfilename, 'a')
|
||||||
raise MesonException('Could not determine vs dep dependency prefix string.')
|
raise MesonException('Could not determine vs dep dependency prefix string.')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue