diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2019-03-21 20:43:54 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-03-24 13:33:27 +0200 |
commit | 3037ade41dc0cfc1cb84b0a668784c8d1af46987 (patch) | |
tree | 0b0947948d732fd33cfbc2f1482c0aad7808080f /mesonbuild/interpreter.py | |
parent | 4e5edff60f4874866d16e7ec43c5927b6af03f8c (diff) | |
download | meson-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.py | 6 |
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.') |