aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ninjabackend.py7
-rw-r--r--test cases/csharp/1 basic/installed_files.txt1
-rw-r--r--test cases/csharp/1 basic/meson.build2
3 files changed, 8 insertions, 2 deletions
diff --git a/ninjabackend.py b/ninjabackend.py
index a58f6c3..21dfd351 100644
--- a/ninjabackend.py
+++ b/ninjabackend.py
@@ -438,11 +438,16 @@ class NinjaBackend(backends.Backend):
subdir = target.get_subdir()
outname_rel = os.path.join(subdir, fname)
src_list = target.get_sources()
- class_list = []
compiler = self.get_compiler_for_source(src_list[0])
assert(compiler.get_language() == 'cs')
rel_srcs = [os.path.join(self.build_to_src, s) for s in src_list]
commands = []
+ if isinstance(target, build.Executable):
+ commands.append('-target:exe')
+ elif isinstance(target, build.SharedLibrary):
+ commands.append('-target:library')
+ else:
+ raise MesonException('Unknown C# target type.')
commands += compiler.get_output_args(outname_rel)
elem = NinjaBuildElement(outname_rel, 'cs_COMPILER', rel_srcs)
elem.add_item('ARGS', commands)
diff --git a/test cases/csharp/1 basic/installed_files.txt b/test cases/csharp/1 basic/installed_files.txt
new file mode 100644
index 0000000..3e93017
--- /dev/null
+++ b/test cases/csharp/1 basic/installed_files.txt
@@ -0,0 +1 @@
+bin/prog.exe
diff --git a/test cases/csharp/1 basic/meson.build b/test cases/csharp/1 basic/meson.build
index 5a1b7b3..2ee6a4a 100644
--- a/test cases/csharp/1 basic/meson.build
+++ b/test cases/csharp/1 basic/meson.build
@@ -1,4 +1,4 @@
project('simple c#', 'cs')
-e = executable('prog', 'prog.cs')
+e = executable('prog', 'prog.cs', install : true)
test('basic', e)