diff options
author | Matthias Klumpp <matthias@tenstral.net> | 2016-08-18 10:42:12 +0200 |
---|---|---|
committer | Matthias Klumpp <matthias@tenstral.net> | 2016-08-19 03:02:51 +0200 |
commit | 56823272ab96892e4f6c8dd86842d8c930281209 (patch) | |
tree | 84587d66fd89acfbb167d372dfdc206eabcdf3d7 /mesonbuild/backend/backends.py | |
parent | 58359c8fac09ecd06af1d389bfad8cd65e831e2a (diff) | |
download | meson-56823272ab96892e4f6c8dd86842d8c930281209.zip meson-56823272ab96892e4f6c8dd86842d8c930281209.tar.gz meson-56823272ab96892e4f6c8dd86842d8c930281209.tar.bz2 |
Implement D support
This patch adds support for the D programming language[1] to Meson.
The following compilers are supported:
* LDC
* GDC
* DMD
[1]: http://dlang.org/
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 1f1c3ca..806a6f3 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -16,6 +16,7 @@ import os, pickle, re from .. import build from .. import dependencies from .. import mesonlib +from .. import compilers import json import subprocess from ..mesonlib import MesonException @@ -233,6 +234,9 @@ class Backend(): def has_swift(self, target): return self.has_source_suffix(target, '.swift') + def has_d(self, target): + return self.has_source_suffix(target, '.d') + def determine_linker(self, target, src): if isinstance(target, build.StaticLibrary): if self.build.static_cross_linker is not None: @@ -358,7 +362,10 @@ class Backend(): if not isinstance(d, build.StaticLibrary) and\ not isinstance(d, build.SharedLibrary): raise RuntimeError('Tried to link with a non-library target "%s".' % d.get_basename()) - args.append(self.get_target_filename_for_linking(d)) + if isinstance(compiler, compilers.LLVMDCompiler): + args.extend(['-L', self.get_target_filename_for_linking(d)]) + else: + args.append(self.get_target_filename_for_linking(d)) # If you have executable e that links to shared lib s1 that links to shared library s2 # you have to specify s2 as well as s1 when linking e even if e does not directly use # s2. Gcc handles this case fine but Clang does not for some reason. Thus we need to |