aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/backend/ninjabackend.py5
-rw-r--r--test cases/csharp/4 external dep/hello.txt1
-rw-r--r--test cases/csharp/4 external dep/meson.build4
-rw-r--r--test cases/csharp/4 external dep/prog.cs8
4 files changed, 17 insertions, 1 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 1f6a80b..e819ab2 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -967,7 +967,7 @@ int dummy;
compiler = target.compilers['cs']
rel_srcs = [s.rel_to_builddir(self.build_to_src) for s in src_list]
deps = []
- commands = target.extra_args.get('cs', [])
+ commands = CompilerArgs(compiler, target.extra_args.get('cs', []))
commands += compiler.get_buildtype_args(buildtype)
if isinstance(target, build.Executable):
commands.append('-target:exe')
@@ -994,6 +994,9 @@ int dummy;
rel_srcs.append(rel_src)
deps.append(rel_src)
+ for dep in target.get_external_deps():
+ commands.extend_direct(dep.get_link_args())
+
elem = NinjaBuildElement(self.all_outputs, outputs, 'cs_COMPILER', rel_srcs)
elem.add_dep(deps)
elem.add_item('ARGS', commands)
diff --git a/test cases/csharp/4 external dep/hello.txt b/test cases/csharp/4 external dep/hello.txt
new file mode 100644
index 0000000..980a0d5
--- /dev/null
+++ b/test cases/csharp/4 external dep/hello.txt
@@ -0,0 +1 @@
+Hello World!
diff --git a/test cases/csharp/4 external dep/meson.build b/test cases/csharp/4 external dep/meson.build
new file mode 100644
index 0000000..004d25f
--- /dev/null
+++ b/test cases/csharp/4 external dep/meson.build
@@ -0,0 +1,4 @@
+project('C# external library', 'cs')
+glib_sharp_2 = dependency('glib-sharp-2.0')
+e = executable('prog', 'prog.cs', dependencies: glib_sharp_2, install : true)
+test('libtest', e, args: [join_paths(meson.current_source_dir(), 'hello.txt')])
diff --git a/test cases/csharp/4 external dep/prog.cs b/test cases/csharp/4 external dep/prog.cs
new file mode 100644
index 0000000..9393fef
--- /dev/null
+++ b/test cases/csharp/4 external dep/prog.cs
@@ -0,0 +1,8 @@
+using System;
+using GLib;
+
+public class Prog {
+ static public void Main (string[] args) {
+ Console.WriteLine(GLib.FileUtils.GetFileContents(args[0]));
+ }
+}