diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-12-14 13:47:27 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-12-15 13:25:16 +0200 |
commit | eb67fb1d976fe363be35c9d3662d36edf3ce1b1d (patch) | |
tree | 88956a0d30df6e4344c4ef2e3c42f5876d1c6fb2 | |
parent | d8921f15a3fe9d037693888943b69a1caba6f1d1 (diff) | |
download | meson-eb67fb1d976fe363be35c9d3662d36edf3ce1b1d.zip meson-eb67fb1d976fe363be35c9d3662d36edf3ce1b1d.tar.gz meson-eb67fb1d976fe363be35c9d3662d36edf3ce1b1d.tar.bz2 |
default inc dirs: Fix warning on MSYS (fixes #6336)
-rw-r--r-- | mesonbuild/compilers/mixins/gnu.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/mesonbuild/compilers/mixins/gnu.py b/mesonbuild/compilers/mixins/gnu.py index 6683486..dcca227 100644 --- a/mesonbuild/compilers/mixins/gnu.py +++ b/mesonbuild/compilers/mixins/gnu.py @@ -100,14 +100,15 @@ def gnulike_default_include_dirs(compiler: typing.Tuple[str], lang: str) -> typi p = subprocess.Popen( cmd, stdin=subprocess.DEVNULL, - stderr=subprocess.PIPE, + stderr=subprocess.STDOUT, stdout=subprocess.PIPE, env=env ) - stderr = p.stderr.read().decode('utf-8', errors='replace') + stdout = p.stdout.read().decode('utf-8', errors='replace') parse_state = 0 paths = [] - for line in stderr.split('\n'): + for line in stdout.split('\n'): + line = line.strip(' \n\r\t') if parse_state == 0: if line == '#include "..." search starts here:': parse_state = 1 @@ -115,14 +116,16 @@ def gnulike_default_include_dirs(compiler: typing.Tuple[str], lang: str) -> typi if line == '#include <...> search starts here:': parse_state = 2 else: - paths.append(line[1:]) + paths.append(line) elif parse_state == 2: if line == 'End of search list.': break else: - paths.append(line[1:]) + paths.append(line) if not paths: mlog.warning('No include directory found parsing "{cmd}" output'.format(cmd=" ".join(cmd))) + # Append a normalized copy of paths to make path lookup easier + paths += [os.path.normpath(x) for x in paths] return paths |