Skip to contentSkip to conversation

meson: Minor improvements

PATCH In review Philippe Mathieu-Daudé 3 participants 8 messages May 25, 2021 – May 27, 2021 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover meson: Minor improvements

Trivial meson improvements, mostly no logical changes, improving summary display.

Philippe Mathieu-Daudé (3):
meson: Only build virtfs-proxy-helper if all requisites are found
meson: List if X11 dependency is detected
meson: List modules built in summary

 meson.build | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
Signature · 1 line
2.26.3
#1 lore raw

PATCH 1/3 meson: Only build virtfs-proxy-helper if all requisites are found

We first set have_virtfs_proxy_helper depending on have_virtfs, then update have_virtfs... While this might work, it is not clear when looking at the code logic. Move the have_virtfs_proxy_helper assignation *after* updating have_virtfs to make it obvious.

---
 meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
meson.build +2 -2
index 632b380738d..2a7d69cf428 100644
@@ -1081,8 +1081,6 @@
     libattr.found() and
     libcap_ng.found())
 
-have_virtfs_proxy_helper = have_virtfs and have_tools
-
 if get_option('virtfs').enabled()
   if not have_virtfs
     if targetos != 'linux'
@@ -1097,6 +1095,8 @@
   have_virtfs = false
 endif
 
+have_virtfs_proxy_helper = have_virtfs and have_tools
+
 config_host_data.set_quoted('CONFIG_BINDIR', get_option('prefix') / get_option('bindir'))
 config_host_data.set_quoted('CONFIG_PREFIX', get_option('prefix'))
 config_host_data.set_quoted('CONFIG_QEMU_CONFDIR', get_option('prefix') / qemu_confdir)
Signature · 1 line
2.26.3
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] meson: Only build virtfs-proxy-helper if all requisites are found

Quoted 9 lines · Philippe Mathieu-Daudé

We first set have_virtfs_proxy_helper depending on have_virtfs, then update have_virtfs... While this might work, it is not clear when looking at the code logic. Move the have_virtfs_proxy_helper assignation*after* updating have_virtfs to make it obvious.

---
  meson.build | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

r~

#3 lore raw

PATCH 2/3 meson: List if X11 dependency is detected

In reply to Philippe Mathieu-Daudé

It is sometimes useful to know if X11 is detected.

---
 meson.build | 1 +
 1 file changed, 1 insertion(+)
meson.build +1 -0
index 2a7d69cf428..5ca1bd36292 100644
@@ -2671,6 +2671,7 @@
 summary_info += {'SDL support':       sdl.found()}
 summary_info += {'SDL image support': sdl_image.found()}
 # TODO: add back version
+summary_info += {'X11 support':       x11.found()}
 summary_info += {'GTK support':       gtk.found()}
 summary_info += {'pixman':            pixman.found()}
 # TODO: add back version
Signature · 1 line
2.26.3
#5 lore raw

PATCH 3/3 meson: List modules built in summary

In reply to Philippe Mathieu-Daudé

Instead of guessing the modules built, list them. Example:

Modules

    audio                        : spice
    block                        : curl dmg-bz2 gluster iscsi rbd ssh
    chardev                      : spice
    hw-display                   :
    hw-s390x                     : virtio-gpu-ccw
    hw-usb                       : redirect smartcard
    ui                           : egl-headless gtk opengl spice-app spice-core
---
 meson.build | 11 +++++++++++
 1 file changed, 11 insertions(+)
meson.build +11 -0
index 5ca1bd36292..54b97ace207 100644
@@ -2738,6 +2738,17 @@
 summary_info += {'FUSE lseek':        fuse_lseek.found()}
 summary(summary_info, bool_yn: true, section: 'Dependencies')
 
+# Modules
+summary_info = {}
+foreach d, list : modules
+  k = []
+    foreach m, _ : list
+      k += [m]
+    endforeach
+  summary_info += {d: ' '.join(k)}
+endforeach
+summary(summary_info, bool_yn: true, section: 'Modules')
+
 if not supported_cpus.contains(cpu)
   message()
   warning('SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEASES!')
Signature · 1 line
2.26.3
#6 lore raw

Re: [PATCH 3/3] meson: List modules built in summary

Quoted 21 lines · Philippe Mathieu-Daudé

Instead of guessing the modules built, list them. Example:

Modules

    audio                        : spice
    block                        : curl dmg-bz2 gluster iscsi rbd ssh
    chardev                      : spice
    hw-display                   :
    hw-s390x                     : virtio-gpu-ccw
    hw-usb                       : redirect smartcard
    ui                           : egl-headless gtk opengl spice-app spice-core
---
 meson.build | 11 +++++++++++
 1 file changed, 11 insertions(+)
meson.build +0 -0
index 5ca1bd36292..54b97ace207 100644

meson.build line 2746

Quoted 9 lines
meson.build +6 -0
@@ -2738,6 +2738,17 @@
 summary_info += {'FUSE lseek':        fuse_lseek.found()}
 summary(summary_info, bool_yn: true, section: 'Dependencies')
 
+# Modules
+summary_info = {}
+foreach d, list : modules
+  k = []
+    foreach m, _ : list
+      k += [m]

Clearer renaming k -> mods, m -> mod and d -> k.

Quoted 9 lines
meson.build +5 -0
+    endforeach
+  summary_info += {d: ' '.join(k)}
+endforeach
+summary(summary_info, bool_yn: true, section: 'Modules')
+
 if not supported_cpus.contains(cpu)
   message()
   warning('SUPPORT FOR THIS HOST CPU WILL GO AWAY IN FUTURE RELEASES!')
#7 lore raw

Re: [PATCH 3/3] meson: List modules built in summary

In reply to Philippe Mathieu-Daudé

meson.build line 2748

Quoted 5 lines · Philippe Mathieu-Daudé
meson.build +5 -0
+  k = []
+    foreach m, _ : list
+      k += [m]
+    endforeach
+  summary_info += {d: ' '.join(k)}

Perhaps:

foreach dir, list : modules
if list.keys().length() > 0

    summary_info += {dir: ' '.join(list.keys())}

endif
endforeach

Paolo

Quoted 3 lines
meson.build +3 -0
+endforeach
+summary(summary_info, bool_yn: true, section: 'Modules')
+