aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2017-04-24 16:56:36 -0700
committerDylan Baker <dylan@pnwbakers.com>2017-05-03 14:33:44 -0700
commit4334c960624f2981e536a46697e429a43fc19f36 (patch)
tree007e216b0aa2b27e3ae853f75a92d65950120e52 /mesonbuild/build.py
parentad79db8f0ac780896df29606655e8b82334e4e2b (diff)
downloadmeson-4334c960624f2981e536a46697e429a43fc19f36.zip
meson-4334c960624f2981e536a46697e429a43fc19f36.tar.gz
meson-4334c960624f2981e536a46697e429a43fc19f36.tar.bz2
Provide a helpful message when a language is required but not included
This happens when building a C project with LLVM, which requires the C++ linker.
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index c8d692e..04fce80 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -909,7 +909,14 @@ You probably should put it in link_with instead.''')
# Pick a compiler based on the language priority-order
for l in clike_langs:
if l in self.compilers or l in dep_langs:
- return all_compilers[l]
+ try:
+ return all_compilers[l]
+ except KeyError:
+ raise MesonException(
+ 'Could not get a dynamic linker for build target {!r}. '
+ 'Requires a linker for language "{}", but that is not '
+ 'a project language.'.format(self.name, l))
+
m = 'Could not get a dynamic linker for build target {!r}'
raise AssertionError(m.format(self.name))