aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 9f4fe6a..4f9cf64 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1568,6 +1568,15 @@ You probably should put it in link_with instead.''')
# Pretty hard to fix because the return value is passed everywhere
return linker, stdlib_args
+ # None of our compilers can do clink, this happens for example if the
+ # target only has ASM sources. Pick the first capable compiler.
+ for l in clink_langs:
+ try:
+ comp = self.all_compilers[l]
+ return comp, comp.language_stdlib_only_link_flags(self.environment)
+ except KeyError:
+ pass
+
raise AssertionError(f'Could not get a dynamic linker for build target {self.name!r}')
def uses_rust(self) -> bool: