summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/detect.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2022-02-09 02:11:30 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2022-02-09 02:11:30 +0200
commitf11c643a82a911f8e9419557dae5d80af9aa3f92 (patch)
treeba6f22ae2342d3888fa1168759c5078f8c916ac2 /mesonbuild/compilers/detect.py
parentd082204096afd51730f44a75bd02423f74c2e5ae (diff)
downloadmeson-crossenvvar.tar.gz
Properly error out when cross file is missing a compiler.crossenvvar
Diffstat (limited to 'mesonbuild/compilers/detect.py')
-rw-r--r--mesonbuild/compilers/detect.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py
index 9216ecfa6..7e6d6556c 100644
--- a/mesonbuild/compilers/detect.py
+++ b/mesonbuild/compilers/detect.py
@@ -240,8 +240,9 @@ def _get_compilers(env: 'Environment', lang: str, for_machine: MachineChoice) ->
# Return value has to be a list of compiler 'choices'
compilers = [comp]
else:
- if not env.machines.matches_build_machine(for_machine):
- raise EnvironmentException(f'{lang!r} compiler binary not defined in cross or native file')
+ # Cross compilers must NEVER EVER be taken from envvars.
+ if env.is_cross_build() and for_machine == MachineChoice.HOST:
+ raise EnvironmentException(f'{lang!r} compiler binary not defined in a cross file')
compilers = [[x] for x in defaults[lang]]
ccache = BinaryTable.detect_compiler_cache()