[Spice-devel] [PATCH spice-common v3 2/3] meson: Do not build generated files twice

Eduardo Lima (Etrunko) etrunko at redhat.com
Thu Apr 4 15:22:18 UTC 2019


From: Frediano Ziglio <fziglio at redhat.com>

spice-gtk and spice-server will use spice_common_client_dep
and spice_common_server_dep as dependencies.
However they will depend on both spice-common client/server
libraries and their sources causing the sources to be compiled
multiple times and causes linker errors on spice-gtk.
The issue can be observed doing a "find -name \*generated\*.o"
in Meson build directory.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Signed-off-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
---
 common/meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/meson.build b/common/meson.build
index e5629af4..980a32af 100644
--- a/common/meson.build
+++ b/common/meson.build
@@ -106,7 +106,7 @@ if spice_common_generate_client_code
                                            install : false,
                                            dependencies : spice_common_dep)
 
-  spice_common_client_dep = declare_dependency(sources : client_marshallers,
+  spice_common_client_dep = declare_dependency(sources : client_marshallers[1],
                                                link_with : spice_common_client_lib,
                                                dependencies : spice_common_dep)
 endif
@@ -164,7 +164,7 @@ if spice_common_generate_server_code
                                            install : false,
                                            dependencies : spice_common_dep)
 
-  spice_common_server_dep = declare_dependency(sources : target,
+  spice_common_server_dep = declare_dependency(sources : target[1],
                                                link_with : spice_common_server_lib,
                                                dependencies : spice_common_dep)
 endif
-- 
2.20.1



More information about the Spice-devel mailing list