diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-08-26 23:42:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-26 23:42:23 +0300 |
commit | 1cd037b578a7d4b731d28728bceb8eed4f633ce5 (patch) | |
tree | 0b6deefd00c80cfb2cab4e46bb7beed2faf6f6a8 | |
parent | a415fafe5666b8d55421bca55b416e6b2ec0d3a7 (diff) | |
parent | aac58f185b19902e08ec63ba976f461796b3df0b (diff) | |
download | meson-1cd037b578a7d4b731d28728bceb8eed4f633ce5.zip meson-1cd037b578a7d4b731d28728bceb8eed4f633ce5.tar.gz meson-1cd037b578a7d4b731d28728bceb8eed4f633ce5.tar.bz2 |
Merge pull request #2248 from thiblahute/csharp
Make cs_args a known argument and handle c# external dependencies
-rw-r--r-- | ciimage/Dockerfile | 1 | ||||
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 7 | ||||
-rw-r--r-- | mesonbuild/interpreter.py | 1 | ||||
-rw-r--r-- | test cases/csharp/4 external dep/hello.txt | 1 | ||||
-rw-r--r-- | test cases/csharp/4 external dep/meson.build | 4 | ||||
-rw-r--r-- | test cases/csharp/4 external dep/prog.cs | 8 |
6 files changed, 21 insertions, 1 deletions
diff --git a/ciimage/Dockerfile b/ciimage/Dockerfile index 5503227..2691900 100644 --- a/ciimage/Dockerfile +++ b/ciimage/Dockerfile @@ -12,4 +12,5 @@ RUN apt-get -y update && apt-get -y upgrade \ && apt-get -y install libboost-log-dev \ && apt-get -y install libvulkan-dev libpcap-dev \ && apt-get -y install gcovr lcov \ +&& apt-get -y install gtk-sharp2 gtk-sharp2-gapi libglib2.0-cil-dev \ && python3 -m pip install hotdoc codecov diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 1f6a80b..dce3b80 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,11 @@ 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()) + commands += self.build.get_project_args(compiler, target.subproject) + commands += self.build.get_global_args(compiler) + elem = NinjaBuildElement(self.all_outputs, outputs, 'cs_COMPILER', rel_srcs) elem.add_dep(deps) elem.add_item('ARGS', commands) diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index a845eff..313f430 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1238,6 +1238,7 @@ lang_arg_kwargs = set(['c_args', 'objcpp_args', 'rust_args', 'vala_args', + 'cs_args', ]) vala_kwargs = set(['vala_header', 'vala_gir', 'vala_vapi']) 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])); + } +} |