aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-06-24 13:29:02 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2018-06-24 21:19:49 +0300
commitc08c8117ab588c6aa679206815f0dea0de1f60a8 (patch)
tree7d3424477274b0be69851a5963930e451d8c28cb
parent1a6765e6318f23ab5c48859907649335c2c05ab0 (diff)
downloadmeson-c08c8117ab588c6aa679206815f0dea0de1f60a8.zip
meson-c08c8117ab588c6aa679206815f0dea0de1f60a8.tar.gz
meson-c08c8117ab588c6aa679206815f0dea0de1f60a8.tar.bz2
Warn if compiler envvars point to cross compilers. Closes #3782.
-rw-r--r--mesonbuild/environment.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 9d1d9e1..48d9fd4 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -450,6 +450,12 @@ class Environment:
return GCC_CYGWIN
return GCC_STANDARD
+ def warn_about_lang_pointing_to_cross(self, compiler_exe, evar):
+ evar_str = os.environ.get(evar, 'WHO_WOULD_CALL_THEIR_COMPILER_WITH_THIS_NAME')
+ if evar_str == compiler_exe:
+ mlog.warning('''Env var %s seems to point to the cross compiler.
+This is probably wrong, it should always point to the native compiler.''' % evar)
+
def _get_compilers(self, lang, evar, want_cross):
'''
The list of compilers is detected in the exact same way for
@@ -463,6 +469,7 @@ class Environment:
ccache = self.detect_ccache()
else:
ccache = []
+ self.warn_about_lang_pointing_to_cross(compilers[0], evar)
# Return value has to be a list of compiler 'choices'
compilers = [compilers]
is_cross = True