[Spice-devel] [PATCH spice-common 2/3] Improve declare_dependency() usage

Eduardo Lima (Etrunko) etrunko at redhat.com
Fri Apr 27 19:25:36 UTC 2018


The superproject will now need to make use of a single variable,
either spice_common_server_dep or spice_common_client_dep, instead of
referencing _include, _libs and _deps separately.

Originally proposed by Christophe Fergeau <cfergeau at redhat.com>

Signed-off-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
---
 common/meson.build | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/common/meson.build b/common/meson.build
index 5eb4f9c..ac65a55 100644
--- a/common/meson.build
+++ b/common/meson.build
@@ -48,6 +48,11 @@ spice_common_lib = static_library('spice-common', spice_common_sources,
                                   include_directories : spice_common_include,
                                   dependencies : spice_common_deps)
 
+spice_common_dep = declare_dependency(link_with : spice_common_lib,
+                                      compile_args : spice_common_glib_cflags,
+                                      include_directories : spice_common_include,
+                                      dependencies : spice_common_deps)
+
 spice_common_generate_code = get_option('generate-code')
 #
 # libspice-common-client
@@ -71,9 +76,12 @@ if spice_common_generate_code == 'all' or spice_common_generate_code == 'client'
 
   spice_common_client_lib = static_library('spice-common-client', spice_common_client_sources,
                                            install : false,
-                                           include_directories : spice_common_include,
-                                           dependencies : spice_common_deps)
-  spice_common_client_dep = declare_dependency(sources : target)
+                                           dependencies : spice_common_dep)
+
+  spice_common_client_dep = declare_dependency(sources : target,
+                                               compile_args : spice_common_glib_cflags,
+                                               link_with : spice_common_client_lib,
+                                               dependencies : spice_common_dep)
 endif
 
 #
@@ -116,7 +124,10 @@ if spice_common_generate_code == 'all' or spice_common_generate_code == 'server'
 
   spice_common_server_lib = static_library('spice-common-server', spice_common_server_sources,
                                            install : false,
-                                           include_directories : spice_common_include,
-                                           dependencies : spice_common_deps)
-  spice_common_server_dep = declare_dependency(sources : target)
+                                           dependencies : spice_common_dep)
+
+  spice_common_server_dep = declare_dependency(sources : target,
+                                               compile_args : spice_common_glib_cflags,
+                                               link_with : spice_common_server_lib,
+                                               dependencies : spice_common_dep)
 endif
-- 
2.14.3



More information about the Spice-devel mailing list