[Spice-commits] meson.build meson_options.txt

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 29 19:26:22 UTC 2018


 meson.build       |   11 ++++-------
 meson_options.txt |    1 -
 2 files changed, 4 insertions(+), 8 deletions(-)

New commits:
commit 7050511d9e5a7e79fd5f3ec46baa64dcba52964b
Author: Eduardo Lima (Etrunko) <etrunko at redhat.com>
Date:   Wed Jun 6 15:02:35 2018 -0300

    meson: Cleanup optional dependency checks
    
    We can follow the same practice as in headers and function checks above,
    by using the dependency name itself to set the configuration data.
    
    Also, if a combo is used, the first value is used as default if none is
    specified. Thus, we can remove the default value for opus from
    meson_options.txt.
    
    Signed-off-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/meson.build b/meson.build
index dd5127a..2b91e82 100644
--- a/meson.build
+++ b/meson.build
@@ -78,7 +78,7 @@ functions = ['alloca',
 
 foreach func : functions
   if compiler.has_function(func)
-    spice_common_config_data.set('HAVE_ at 0@'.format(func.to_upper()), '1')
+    spice_common_config_data.set('HAVE_ at 0@'.format(func.underscorify().to_upper()), '1')
   endif
 endforeach
 
@@ -113,12 +113,9 @@ endforeach
 #
 # Non-mandatory/optional dependencies
 #
-# Check deps which are optional but enabled by default. This foreach block only
-# checks the option, and adds the package to the deps list, while the real check
-# for the dependency is done in the foreach block below.
 optional_deps = [
-                    ['celt051', '>= 0.5.1.1', 'HAVE_CELT051'],
-                    ['opus', '>= 0.9.14', 'HAVE_OPUS'],
+                    ['celt051', '>= 0.5.1.1'],
+                    ['opus', '>= 0.9.14'],
                 ]
 foreach dep : optional_deps
   option_value = get_option(dep[0])
@@ -126,7 +123,7 @@ foreach dep : optional_deps
     d = dependency(dep[0], required: (option_value == 'true'), version : dep[1])
     if d.found()
       spice_common_deps += d
-      spice_common_config_data.set(dep[2], '1')
+      spice_common_config_data.set('HAVE_ at 0@'.format(dep[0].underscorify().to_upper()), '1')
     endif
   endif
 endforeach
diff --git a/meson_options.txt b/meson_options.txt
index 6994d91..3d04b4d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -19,7 +19,6 @@ option('celt051',
 option('opus',
     type : 'combo',
     choices : ['true', 'false', 'auto'],
-    value : 'true',
     description: 'Enable Opus audio codec (default=true)')
 
 option('python-checks',


More information about the Spice-commits mailing list