Merge pull request #2564 from jeandet/fix_boost_detection_with_wrong_locale

Fix detection of include dirs with gnu compiler and non US locale
pull/2593/head
Jussi Pakkanen 7 years ago committed by GitHub
commit 9426033e97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      mesonbuild/compilers/compilers.py

@ -923,11 +923,15 @@ 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'
cmd = compiler + ['-x{}'.format(lang), '-E', '-v', '-']
p = subprocess.Popen(
compiler + ['-x{}'.format(lang), '-E', '-v', '-'],
cmd,
stdin=subprocess.DEVNULL,
stderr=subprocess.PIPE,
stdout=subprocess.PIPE
stdout=subprocess.PIPE,
env=env
)
stderr = p.stderr.read().decode('utf-8')
parse_state = 0
@ -946,6 +950,8 @@ def gnulike_default_include_dirs(compiler, lang):
break
else:
paths.append(line[1:])
if len(paths) == 0:
mlog.warning('No include directory found parsing "{cmd}" output'.format(cmd=" ".join(cmd)))
return paths
class GnuCompiler:

Loading…
Cancel
Save