From adeecf4b4ad40052383e5e78c122e547ce84b131 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 4 Oct 2017 17:07:26 -0300 Subject: [PATCH] Run tests only when using mono and set MONO_PATH --- ges/meson.build | 10 +++++++--- meson.build | 10 ++++++++++ sources/meson.build | 9 +++++++-- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/ges/meson.build b/ges/meson.build index 2193df0161..aecf93239b 100644 --- a/ges/meson.build +++ b/ges/meson.build @@ -16,7 +16,7 @@ configure_file( output: pkg + '-sharp.dll.config', configuration: configuration_data()) -if add_languages('c', required: false) +if add_languages('c', required: false) and csc.get_id() == 'mono' c_abi_exe = executable(pkg + '_c_abi', c_abi, c_args: ['-Wno-deprecated', '-Wno-deprecated-declarations'], dependencies: [gst_deps, ges_dep]) @@ -25,6 +25,10 @@ if add_languages('c', required: false) cs_args: ['-nowarn:169', '-nowarn:108', '-nowarn:114', '-nowarn:0618', '-unsafe'], dependencies: [ges_sharp_dep]) - test(pkg + 'abi', diff, args: [c_abi_exe.full_path(), cs_abi_exe.full_path()]) + env = environment() + env.prepend('MONO_PATH', mono_path) + test(pkg + 'abi', diff, args: [c_abi_exe.full_path(), cs_abi_exe.full_path()], + env: env) +else + message('Not running tests ' + csc.get_id()) endif - diff --git a/meson.build b/meson.build index 639401bb51..3142c38858 100644 --- a/meson.build +++ b/meson.build @@ -40,6 +40,15 @@ else gtk_sharp_dep = dependency('gtk-sharp-3.0', version: gtk_sharp_required_version, required: false) endif + +if host_machine.system() == 'windows' + pathsep = ';' +else + pathsep = ':' +endif +mono_path = gtk_sharp.get_variable('mono_path') + pathsep +mono_path += pathsep + join_paths(meson.current_build_dir(), 'sources') + codegen_dependencies = [gapi_codegen, gapi_fixup, glib_sharp, gio_sharp] gapi_fixup = gapi_fixup.full_path() gapi_codegen = gapi_codegen.full_path() @@ -80,6 +89,7 @@ ges_dep = dependency('gst-editing-services-' + apiversion, version: gst_required subdir('sources') if ges_dep.found() + mono_path += pathsep + join_paths(meson.current_build_dir(), 'ges') subdir('ges') custom_target('GESSharp-nuget', command: [nuget, '--package-name', 'GESSharp', diff --git a/sources/meson.build b/sources/meson.build index 2cea50447a..306537f9c5 100644 --- a/sources/meson.build +++ b/sources/meson.build @@ -41,7 +41,7 @@ gst_sharp = library('gstreamer-sharp', gst_source_gen, sources, gst_sharp_dep = declare_dependency(dependencies: [glib_sharp_dep, gio_sharp_dep], link_with: gst_sharp) -if add_languages('c', required: false) +if add_languages('c', required: false) and csc.get_id() == 'mono' c_abi_exe = executable('gst_sharp_c_abi', c_abi, cs_args: ['-nowarn:169', '-nowarn:108', '-nowarn:114', '-unsafe'], dependencies: [gst_deps]) @@ -50,7 +50,12 @@ if add_languages('c', required: false) cs_args: ['-nowarn:169', '-nowarn:108', '-nowarn:114', '-unsafe'], dependencies: [gst_sharp_dep]) - test('gstreamer_sharp_abi', diff, args: [c_abi_exe.full_path(), cs_abi_exe.full_path()]) + env = environment() + env.prepend('MONO_PATH', mono_path) + test('gstreamer_sharp_abi', diff, args: [c_abi_exe.full_path(), cs_abi_exe.full_path()], + env: env) +else + message('Not running tests ' + csc.get_id()) endif configure_file(