aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2019-03-21 20:43:54 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2019-03-24 13:33:27 +0200
commit3037ade41dc0cfc1cb84b0a668784c8d1af46987 (patch)
tree0b0947948d732fd33cfbc2f1482c0aad7808080f /mesonbuild/interpreter.py
parent4e5edff60f4874866d16e7ec43c5927b6af03f8c (diff)
downloadmeson-3037ade41dc0cfc1cb84b0a668784c8d1af46987.zip
meson-3037ade41dc0cfc1cb84b0a668784c8d1af46987.tar.gz
meson-3037ade41dc0cfc1cb84b0a668784c8d1af46987.tar.bz2
Inline check_compilers
This function is used just once. It also seems all policy and no mechanism (it raises, it calls the same function to do all the work twice in a simple way). This makes it seem to be as a good candidate for inlining. `environment` and `coredata` are woefully intertwined and while this change doesn't fix that, but at least it makes it easier to follow.
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r--mesonbuild/interpreter.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 1e094dd..654f627 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -2696,7 +2696,11 @@ external dependencies (including libraries) must go to "dependencies".''')
else:
try:
(comp, cross_comp) = self.environment.detect_compilers(lang, need_cross_compiler)
- self.environment.check_compilers(lang, comp, cross_comp)
+ if comp is None:
+ raise InvalidArguments('Tried to use unknown language "%s".' % lang)
+ comp.sanity_check(self.environment.get_scratch_dir(), self.environment)
+ if cross_comp:
+ cross_comp.sanity_check(self.environment.get_scratch_dir(), self.environment)
except Exception:
if not required:
mlog.log('Compiler for language', mlog.bold(lang), 'not found.')