[glib/wip/meson] meson: gio tests need to link against gobject as well



commit 1240cbf6bd5b5016af4b1bd4fadb7a25d5cb992b
Author: Tim-Philipp Müller <tim centricular com>
Date:   Sun Jun 4 16:13:21 2017 +0100

    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.

 gio/tests/meson.build |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index 2674c0e..754e3ae 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -1,3 +1,5 @@
+common_gio_tests_deps = [libglib_dep, libgmodule_dep, libgobject_dep, libgio_dep]
+
 subdir('gdbus-object-manager-example')
 
 gengiotypefuncs_prog = find_program('gengiotypefuncs.py')
@@ -85,7 +87,7 @@ if dbus1_dep.found()
       'gdbus-serialization.c', 'gdbus-tests.c',
       install : false,
       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)
 endif
 
@@ -182,7 +184,7 @@ if host_machine.system() != 'windows'
           'gdbus-sessionbus.c', 'gdbus-tests.c', extra_src,
           install : false,
           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)
     endforeach
 
@@ -190,7 +192,7 @@ if host_machine.system() != 'windows'
           'gdbus-sessionbus.c', 'gdbus-tests.c', gdbus_test_codegen_generated,
           install : false,
           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)
 
     # 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',
                        install : false,
                        c_args : test_c_args,
-                       dependencies : [libglib_dep, libgmodule_dep, libgio_dep])
+                       dependencies : common_gio_tests_deps)
     endif
     test('gapplication', exe, env : test_env)
 
@@ -213,20 +215,20 @@ if host_machine.system() != 'windows'
   executable('gdbus-overflow', 'gdbus-overflow.c',
       install : false,
       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',
       'test-io-stream.c', 'test-pipe-unix.c',
       install : false,
       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)
 
   exe = executable('gdbus-non-socket', 'gdbus-non-socket.c',
       'gdbus-tests.c', 'test-io-stream.c', 'test-pipe-unix.c',
       install : false,
       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)
 
   # Generate test.mo from de.po using msgfmt
@@ -240,7 +242,7 @@ if host_machine.system() != 'windows'
                    '-DSRCDIR="@0@"'.format(meson.current_source_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)
   endif
 endif # unix
@@ -270,7 +272,7 @@ foreach test_name : gio_tests
   exe = executable(test_name, srcs,
       install : false,
       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'
     test(test_name, exe, env : test_env, timeout : 45)
   else
@@ -329,7 +331,7 @@ foreach extra_program : uninstalled_test_extra_programs + test_extra_programs
   executable(extra_program[0], srcs,
       install : false,
       c_args : test_c_args,
-      dependencies : [libglib_dep, libgmodule_dep, libgio_dep] + extra_deps)
+      dependencies : common_gio_tests_deps + extra_deps)
 endforeach
 
 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
   shared_module ('resourceplugin', 'resourceplugin.c', plugin_resources_c,
     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',
     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,
       install : false,
       c_args : test_c_args,
-      dependencies : [libglib_dep, libgmodule_dep, libgio_dep])
+      dependencies : common_gio_tests_deps)
   test('resources', exe, env : test_env)
 endif
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]