Run tests only when using mono and set MONO_PATH

This commit is contained in:
Thibault Saunier 2017-10-04 17:07:26 -03:00
parent 288b061843
commit adeecf4b4a
3 changed files with 24 additions and 5 deletions

View file

@ -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

View file

@ -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',

View file

@ -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(