aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/compilers.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-11-07 23:59:50 +0200
committerGitHub <noreply@github.com>2017-11-07 23:59:50 +0200
commit9426033e97e7aa4fa3731353c3bbc8fcccfeb52c (patch)
tree9ea6ed86e9cd1be235041cb6d6861dee4af63513 /mesonbuild/compilers/compilers.py
parent7121eb8c51cc42d44879f31321511469be9caa8e (diff)
parentdfab58772fea93552aca341f774ab44805853a0d (diff)
downloadmeson-9426033e97e7aa4fa3731353c3bbc8fcccfeb52c.zip
meson-9426033e97e7aa4fa3731353c3bbc8fcccfeb52c.tar.gz
meson-9426033e97e7aa4fa3731353c3bbc8fcccfeb52c.tar.bz2
Merge pull request #2564 from jeandet/fix_boost_detection_with_wrong_locale
Fix detection of include dirs with gnu compiler and non US locale
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r--mesonbuild/compilers/compilers.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 3f088b0..bacf478 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/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: