diff options
author | Paolo Borelli <pborelli@gnome.org> | 2017-04-23 10:40:36 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-04-29 12:35:47 +0300 |
commit | 83c5c738dd816f4720ca6be39098e35a6bb9ab07 (patch) | |
tree | c5fc4c4af6c90f4fb11788e687f197a6af26db57 | |
parent | d542b2c0ccdc4f7985d7f17c5d58709b6fbd8058 (diff) | |
download | meson-83c5c738dd816f4720ca6be39098e35a6bb9ab07.zip meson-83c5c738dd816f4720ca6be39098e35a6bb9ab07.tar.gz meson-83c5c738dd816f4720ca6be39098e35a6bb9ab07.tar.bz2 |
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.
-rw-r--r-- | authors.txt | 1 | ||||
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 11 |
2 files changed, 9 insertions, 3 deletions
diff --git a/authors.txt b/authors.txt index 72df2c2..1cfcad7 100644 --- a/authors.txt +++ b/authors.txt @@ -83,3 +83,4 @@ Rafael Fontenelle Michael Olbrich Ernestas Kulik Thomas Hindoe Paaboel Andersen +Paolo Borelli diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index d8be828..2c3880b 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -175,11 +175,16 @@ int dummy; stdout=subprocess.PIPE, stderr=subprocess.PIPE) (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'): - if line.endswith(b'stdio.h'): - matchstr = b':'.join(line.split(b':')[0:2]) + b':' + match = matchre.match(line) + if match: 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') raise MesonException('Could not determine vs dep dependency prefix string.') |