[PATCH 3/7] tests: add missing generated sources to testqapi

Paolo Bonzini posted 7 patches 5 years, 2 months ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, Eduardo Habkost <ehabkost@redhat.com>, Fam Zheng <fam@euphon.net>, Ed Maste <emaste@freebsd.org>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, Li-Wen Hsu <lwhsu@freebsd.org>, Cleber Rosa <crosa@redhat.com>
[PATCH 3/7] tests: add missing generated sources to testqapi
Posted by Paolo Bonzini 5 years, 2 months ago
Ninja notices them due to a different order in visiting the graph.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 tests/include/meson.build |  8 ++++----
 tests/meson.build         | 14 ++++++++++++--
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/tests/include/meson.build b/tests/include/meson.build
index fea3a6342f..9abba308fa 100644
--- a/tests/include/meson.build
+++ b/tests/include/meson.build
@@ -10,7 +10,7 @@ test_qapi_outputs_extra = [
   'test-qapi-visit-sub-module.h',
 ]
 
-test_qapi_outputs_extra = custom_target('QAPI test (include)',
-                                        output: test_qapi_outputs_extra,
-                                        input: test_qapi_files,
-                                        command: 'true')
+test_qapi_files_extra = custom_target('QAPI test (include)',
+                                      output: test_qapi_outputs_extra,
+                                      input: test_qapi_files,
+                                      command: 'true')
diff --git a/tests/meson.build b/tests/meson.build
index bf47a38c74..afeb6be689 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -56,8 +56,18 @@ test_qapi_files = custom_target('Test QAPI files',
 # perhaps change qapi_gen to replace / with _, like Meson itself does?
 subdir('include')
 
-libtestqapi = static_library('testqapi', sources: [test_qapi_files, genh, test_qapi_outputs_extra])
-testqapi = declare_dependency(link_with: libtestqapi)
+test_qapi_sources = []
+test_qapi_headers = []
+i = 0
+foreach o: test_qapi_files.to_list() + test_qapi_files_extra.to_list()
+  if o.full_path().endswith('.h')
+    test_qapi_headers += o
+  endif
+  test_qapi_sources += o
+endforeach
+
+libtestqapi = static_library('testqapi', sources: [genh, test_qapi_sources])
+testqapi = declare_dependency(link_with: libtestqapi, sources: [genh, test_qapi_headers])
 
 testblock = declare_dependency(dependencies: [block], sources: 'iothread.c')
 
-- 
2.26.2



Re: [PATCH 3/7] tests: add missing generated sources to testqapi
Posted by Daniel P. Berrangé 5 years, 2 months ago
On Wed, Oct 14, 2020 at 09:54:12AM -0400, Paolo Bonzini wrote:
> Ninja notices them due to a different order in visiting the graph.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  tests/include/meson.build |  8 ++++----
>  tests/meson.build         | 14 ++++++++++++--
>  2 files changed, 16 insertions(+), 6 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|