meson: gio tests need to link against gobject as well

With meson from git dependencies of dependencies are no
longer added automatically and recursively to the linker
lines. Meaning dependencies that are used have to be
passed directly and explicitly or we'll get linker errors.
This commit is contained in:
Tim-Philipp Müller 2017-06-04 16:13:21 +01:00 committed by Matthias Clasen
parent 24ea260b4c
commit 10ae386727

View File

@ -1,3 +1,5 @@
common_gio_tests_deps = [libglib_dep, libgmodule_dep, libgobject_dep, libgio_dep]
subdir('gdbus-object-manager-example') subdir('gdbus-object-manager-example')
gengiotypefuncs_prog = find_program('gengiotypefuncs.py') gengiotypefuncs_prog = find_program('gengiotypefuncs.py')
@ -85,7 +87,7 @@ if dbus1_dep.found()
'gdbus-serialization.c', 'gdbus-tests.c', 'gdbus-serialization.c', 'gdbus-tests.c',
install : false, install : false,
c_args : test_c_args, c_args : test_c_args,
dependencies : [libglib_dep, libgmodule_dep, libgio_dep, dbus1_dep]) dependencies : common_gio_tests_deps + [dbus1_dep])
test('gdbus-serialization', exe, env : test_env) test('gdbus-serialization', exe, env : test_env)
endif endif
@ -182,7 +184,7 @@ if host_machine.system() != 'windows'
'gdbus-sessionbus.c', 'gdbus-tests.c', extra_src, 'gdbus-sessionbus.c', 'gdbus-tests.c', extra_src,
install : false, install : false,
c_args : test_c_args, c_args : test_c_args,
dependencies : [libglib_dep, libgmodule_dep, libgio_dep] + extra_deps) dependencies : common_gio_tests_deps + extra_deps)
test(test_name, exe, env : test_env) test(test_name, exe, env : test_env)
endforeach endforeach
@ -190,7 +192,7 @@ if host_machine.system() != 'windows'
'gdbus-sessionbus.c', 'gdbus-tests.c', gdbus_test_codegen_generated, 'gdbus-sessionbus.c', 'gdbus-tests.c', gdbus_test_codegen_generated,
install : false, install : false,
c_args : test_c_args + ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36', '-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36'], c_args : test_c_args + ['-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36', '-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36'],
dependencies : [libglib_dep, libgmodule_dep, libgio_dep]) dependencies : common_gio_tests_deps)
test('gdbus-test-codegen-old', exe, env : test_env) test('gdbus-test-codegen-old', exe, env : test_env)
# There is already a gapplication exe target in gio so need to use a # There is already a gapplication exe target in gio so need to use a
@ -202,7 +204,7 @@ if host_machine.system() != 'windows'
'gdbus-sessionbus.c', 'gdbus-tests.c', 'gdbus-sessionbus.c', 'gdbus-tests.c',
install : false, install : false,
c_args : test_c_args, c_args : test_c_args,
dependencies : [libglib_dep, libgmodule_dep, libgio_dep]) dependencies : common_gio_tests_deps)
endif endif
test('gapplication', exe, env : test_env) test('gapplication', exe, env : test_env)
@ -213,20 +215,20 @@ if host_machine.system() != 'windows'
executable('gdbus-overflow', 'gdbus-overflow.c', executable('gdbus-overflow', 'gdbus-overflow.c',
install : false, install : false,
c_args : test_c_args, c_args : test_c_args,
dependencies : [libglib_dep, libgmodule_dep, libgio_dep]) dependencies : common_gio_tests_deps)
exe = executable('gdbus-connection-flush', 'gdbus-connection-flush.c', exe = executable('gdbus-connection-flush', 'gdbus-connection-flush.c',
'test-io-stream.c', 'test-pipe-unix.c', 'test-io-stream.c', 'test-pipe-unix.c',
install : false, install : false,
c_args : test_c_args, c_args : test_c_args,
dependencies : [libglib_dep, libgmodule_dep, libgio_dep]) dependencies : common_gio_tests_deps)
test('gdbus-connection-flush', exe, env : test_env) test('gdbus-connection-flush', exe, env : test_env)
exe = executable('gdbus-non-socket', 'gdbus-non-socket.c', exe = executable('gdbus-non-socket', 'gdbus-non-socket.c',
'gdbus-tests.c', 'test-io-stream.c', 'test-pipe-unix.c', 'gdbus-tests.c', 'test-io-stream.c', 'test-pipe-unix.c',
install : false, install : false,
c_args : test_c_args, c_args : test_c_args,
dependencies : [libglib_dep, libgmodule_dep, libgio_dep]) dependencies : common_gio_tests_deps)
test('gdbus-non-socket', exe, env : test_env) test('gdbus-non-socket', exe, env : test_env)
# Generate test.mo from de.po using msgfmt # Generate test.mo from de.po using msgfmt
@ -240,7 +242,7 @@ if host_machine.system() != 'windows'
'-DSRCDIR="@0@"'.format(meson.current_source_dir()), '-DSRCDIR="@0@"'.format(meson.current_source_dir()),
'-DTEST_LOCALE_PATH="@0@"'.format(test_mo_dir), '-DTEST_LOCALE_PATH="@0@"'.format(test_mo_dir),
], ],
dependencies : [libglib_dep, libgmodule_dep, libgio_dep]) dependencies : common_gio_tests_deps)
test('gsettings', exe, env : test_env) test('gsettings', exe, env : test_env)
endif endif
endif # unix endif # unix
@ -270,7 +272,7 @@ foreach test_name : gio_tests
exe = executable(test_name, srcs, exe = executable(test_name, srcs,
install : false, install : false,
c_args : test_c_args, c_args : test_c_args,
dependencies : [libglib_dep, libgmodule_dep, libgio_dep] + extra_deps) dependencies : common_gio_tests_deps + extra_deps)
if test_name == 'testfilemonitor' if test_name == 'testfilemonitor'
test(test_name, exe, env : test_env, timeout : 45) test(test_name, exe, env : test_env, timeout : 45)
else else
@ -329,7 +331,7 @@ foreach extra_program : uninstalled_test_extra_programs + test_extra_programs
executable(extra_program[0], srcs, executable(extra_program[0], srcs,
install : false, install : false,
c_args : test_c_args, c_args : test_c_args,
dependencies : [libglib_dep, libgmodule_dep, libgio_dep] + extra_deps) dependencies : common_gio_tests_deps + extra_deps)
endforeach endforeach
if not meson.is_cross_build() or meson.has_exe_wrapper() if not meson.is_cross_build() or meson.has_exe_wrapper()
@ -351,7 +353,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
endif endif
shared_module ('resourceplugin', 'resourceplugin.c', plugin_resources_c, shared_module ('resourceplugin', 'resourceplugin.c', plugin_resources_c,
link_args : ['-export-dynamic'] + resource_plugin_platform_link_args, link_args : ['-export-dynamic'] + resource_plugin_platform_link_args,
dependencies : [libglib_dep, libgmodule_dep, libgio_dep]) dependencies : common_gio_tests_deps)
test_gresource = custom_target('test.gresource', test_gresource = custom_target('test.gresource',
input : 'test.gresource.xml', input : 'test.gresource.xml',
@ -404,7 +406,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
test_resources_c, test_resources2_c, test_resources2_h, test_resources_c, test_resources2_c, test_resources2_h,
install : false, install : false,
c_args : test_c_args, c_args : test_c_args,
dependencies : [libglib_dep, libgmodule_dep, libgio_dep]) dependencies : common_gio_tests_deps)
test('resources', exe, env : test_env) test('resources', exe, env : test_env)
endif endif