Set up link paths.

pull/15/head
Jussi Pakkanen 11 years ago
parent 09c24654a6
commit 7814ef986f
  1. 3
      environment.py
  2. 5
      ninjabackend.py
  3. 7
      test cases/csharp/2 library/helper.cs
  4. 2
      test cases/csharp/2 library/installed_files.txt
  5. 5
      test cases/csharp/2 library/meson.build
  6. 8
      test cases/csharp/2 library/prog.cs

@ -468,6 +468,9 @@ class MonoCompiler():
def get_linker_always_args(self):
return []
def get_link_args(self, fname):
return ['-r:' + fname]
def get_soname_args(self, shlib_name, path):
return []

@ -449,7 +449,12 @@ class NinjaBackend(backends.Backend):
else:
raise MesonException('Unknown C# target type.')
commands += compiler.get_output_args(outname_rel)
deps = []
for l in target.link_targets:
commands += compiler.get_link_args(l.get_filename())
deps.append(l.get_filename())
elem = NinjaBuildElement(outname_rel, 'cs_COMPILER', rel_srcs)
elem.add_dep(deps)
elem.add_item('ARGS', commands)
elem.write(outfile)

@ -0,0 +1,7 @@
using System;
public class Helper {
public void print() {
Console.WriteLine("Library class called.");
}
}

@ -0,0 +1,2 @@
bin/prog.exe
lib/libhelper.dll

@ -0,0 +1,5 @@
project('C# library', 'cs')
l = shared_library('helper', 'helper.cs', install : true)
e = executable('prog', 'prog.cs', link_with : l, install : true)
test('libtest', e)

@ -0,0 +1,8 @@
using System;
public class Prog {
static public void Main () {
Helper h = new Helper();
h.print();
}
}
Loading…
Cancel
Save