diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2014-07-19 01:14:21 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2014-07-19 01:14:21 +0300 |
commit | 7814ef986fc0413630a7a6b7dbc169fc2ce39b03 (patch) | |
tree | 958e8e63592756e469b356b49ad3b81245779cfc | |
parent | 09c24654a69a737f7079befe251ba0a89932035d (diff) | |
download | meson-7814ef986fc0413630a7a6b7dbc169fc2ce39b03.zip meson-7814ef986fc0413630a7a6b7dbc169fc2ce39b03.tar.gz meson-7814ef986fc0413630a7a6b7dbc169fc2ce39b03.tar.bz2 |
Set up link paths.
-rw-r--r-- | environment.py | 3 | ||||
-rw-r--r-- | ninjabackend.py | 5 | ||||
-rw-r--r-- | test cases/csharp/2 library/helper.cs | 7 | ||||
-rw-r--r-- | test cases/csharp/2 library/installed_files.txt | 2 | ||||
-rw-r--r-- | test cases/csharp/2 library/meson.build | 5 | ||||
-rw-r--r-- | test cases/csharp/2 library/prog.cs | 8 |
6 files changed, 30 insertions, 0 deletions
diff --git a/environment.py b/environment.py index 07c1c28..4c6a36a 100644 --- a/environment.py +++ b/environment.py @@ -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 [] diff --git a/ninjabackend.py b/ninjabackend.py index 21dfd351..c9f6993 100644 --- a/ninjabackend.py +++ b/ninjabackend.py @@ -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) diff --git a/test cases/csharp/2 library/helper.cs b/test cases/csharp/2 library/helper.cs new file mode 100644 index 0000000..266e379 --- /dev/null +++ b/test cases/csharp/2 library/helper.cs @@ -0,0 +1,7 @@ +using System; + +public class Helper { + public void print() { + Console.WriteLine("Library class called."); + } +} diff --git a/test cases/csharp/2 library/installed_files.txt b/test cases/csharp/2 library/installed_files.txt new file mode 100644 index 0000000..48d5277 --- /dev/null +++ b/test cases/csharp/2 library/installed_files.txt @@ -0,0 +1,2 @@ +bin/prog.exe +lib/libhelper.dll diff --git a/test cases/csharp/2 library/meson.build b/test cases/csharp/2 library/meson.build new file mode 100644 index 0000000..2082e03 --- /dev/null +++ b/test cases/csharp/2 library/meson.build @@ -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) diff --git a/test cases/csharp/2 library/prog.cs b/test cases/csharp/2 library/prog.cs new file mode 100644 index 0000000..8bf6a31 --- /dev/null +++ b/test cases/csharp/2 library/prog.cs @@ -0,0 +1,8 @@ +using System; + +public class Prog { + static public void Main () { + Helper h = new Helper(); + h.print(); + } +} |