[meld: 1/10] build: Limit the profile option




commit c6445f12bcea66ebac5fb1b92f42dbe64b5780c2
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Sun Feb 14 20:14:03 2021 +0100

    build: Limit the profile option
    
    Profile option has been changed to `combo` build option, allowing
    only a limited set of profiles.
    
    This also improves its handling by meson.

 meson.build       | 9 ++-------
 meson_options.txt | 4 ++--
 2 files changed, 4 insertions(+), 9 deletions(-)
---
diff --git a/meson.build b/meson.build
index 2324fd27..1846d54f 100644
--- a/meson.build
+++ b/meson.build
@@ -23,13 +23,8 @@ dependency('pygobject-3.0', version: '>= 3.30')
 dependency('py3cairo', version: '>= 1.15.0')
 
 
-if get_option('profile') == 'Devel'
-    name_suffix = ' (Development Snapshot)'
-    profile = 'Devel'
-else
-    name_suffix = ''
-    profile = ''
-endif
+profile = get_option('profile')
+name_suffix = (profile == 'Devel' ? ' (Development Snapshot)' : '')
 
 resource_base_id = 'org.gnome.meld'
 application_id_no_profile = 'org.gnome.Meld'
diff --git a/meson_options.txt b/meson_options.txt
index 9c545a9c..f2e2e873 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,7 +1,7 @@
 option(
   'profile',
-  type: 'string',
-  value: '',
+  type: 'combo',
+  choices: ['', 'Devel'],
   description: 'Build with specified application ID',
 )
 option(


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