From c08c8117ab588c6aa679206815f0dea0de1f60a8 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sun, 24 Jun 2018 13:29:02 +0300 Subject: Warn if compiler envvars point to cross compilers. Closes #3782. --- mesonbuild/environment.py | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- cgit v1.1