[gnome-control-center/gbsneto/meson-cleanup] meson: Use summary instead of manually built string




commit d11b819c6ffabeb09c7bc37f40fe1a334c72c6b9
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sat Oct 3 20:06:53 2020 -0300

    meson: Use summary instead of manually built string
    
    It simplifies the code, and allows us to have some consistency
    between projects (either inside and outside GNOME, mind you).
    
    I took the liberty to rename and reword some of the options so
    that they actually describe which ones are optional, and also
    which ones are hard dependencies detected at build time.

 meson.build | 36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)
---
diff --git a/meson.build b/meson.build
index a5a7ce53d..0fde42fe2 100644
--- a/meson.build
+++ b/meson.build
@@ -2,7 +2,7 @@ project(
   'gnome-control-center', 'c',
         version : '40.alpha',
         license : 'GPL2+',
-  meson_version : '>= 0.51.0'
+  meson_version : '>= 0.53.0'
 )
 
 control_center_prefix = get_option('prefix')
@@ -291,21 +291,19 @@ configure_file(
   configuration: config_h
 )
 
-output = ''
-output += '\n        ' + meson.project_name() + ' - ' + meson.project_version() + '\n'
-output += '    ===================================\n'
-output += ' Options \n'
-output += '     Documentation .............................. ' + get_option('documentation').to_string() + 
'\n'
-output += '     Build Tests ................................ ' + get_option('tests').to_string() + '\n'
-output += '     Tracing .................................... ' + enable_tracing.to_string() + '\n'
-output += '     Optimized .................................. ' + control_center_optimized.to_string() + '\n'
-output += ' Panels \n'
-output += '     GNOME Bluetooth (Bluetooth panel) .......... ' + host_is_linux_not_s390.to_string() + '\n'
-output += '     Cheese (Users panel webcam support) ........ ' + enable_cheese.to_string() + '\n'
-output += '     IBus (Region panel IBus support) ........... ' + enable_ibus.to_string() + '\n'
-output += '     NetworkManager (Network panel) ............. ' + host_is_linux.to_string() + '\n'
-output += '     Wacom (Wacom tablet panel) ................. ' + host_is_linux_not_s390.to_string() + '\n'
-output += '     Snap support ............................... ' + enable_snap.to_string() + '\n'
-output += '     Malcontent support ......................... ' + enable_malcontent.to_string() + '\n'
-
-message(output)
+summary({
+  'Documentation': get_option('documentation'),
+  'Tests': get_option('tests'),
+  'Tracing': enable_tracing,
+  'Optimized': control_center_optimized,
+})
+
+summary({
+  'GNOME Bluetooth': host_is_linux_not_s390,
+  'Cheese': enable_cheese,
+  'IBus': enable_ibus,
+  'NetworkManager': host_is_linux,
+  'Wacom': host_is_linux_not_s390,
+  'Snap': enable_snap,
+  'Malcontent': enable_malcontent,
+}, section: 'Optional Dependencies')


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