c#: Handle external dependencies from .pc files

pull/2248/head
Thibault Saunier 7 years ago
parent 596c7106f7
commit 52b7f1a096
  1. 5
      mesonbuild/backend/ninjabackend.py
  2. 1
      test cases/csharp/4 external dep/hello.txt
  3. 4
      test cases/csharp/4 external dep/meson.build
  4. 8
      test cases/csharp/4 external dep/prog.cs

@ -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)

@ -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')])

@ -0,0 +1,8 @@
using System;
using GLib;
public class Prog {
static public void Main (string[] args) {
Console.WriteLine(GLib.FileUtils.GetFileContents(args[0]));
}
}
Loading…
Cancel
Save