Fix detection of include dirs with gnu compiler and non C locale

Auto detection was based on parsing gcc's output so we have to
ensure that it is always 'C'.

Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
pull/2564/head
Alexis Jeandet 7 years ago
parent cde0f4fca1
commit f15a57f31a
  1. 5
      mesonbuild/compilers/compilers.py

@ -923,11 +923,14 @@ def get_largefile_args(compiler):
def gnulike_default_include_dirs(compiler, lang):
if lang == 'cpp':
lang = 'c++'
env = os.environ.copy()
env["LC_ALL"] = 'C'
p = subprocess.Popen(
compiler + ['-x{}'.format(lang), '-E', '-v', '-'],
stdin=subprocess.DEVNULL,
stderr=subprocess.PIPE,
stdout=subprocess.PIPE
stdout=subprocess.PIPE,
env=env
)
stderr = p.stderr.read().decode('utf-8')
parse_state = 0

Loading…
Cancel
Save