[Spice-commits] 2 commits - meson.build meson_options.txt

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 6 11:17:19 UTC 2018


 meson.build       |   29 ++++++++++++-----------------
 meson_options.txt |   12 +++++++-----
 2 files changed, 19 insertions(+), 22 deletions(-)

New commits:
commit a84f868e48035a9442ffc30a0a52559c9cf3fe54
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Wed Jun 6 12:58:56 2018 +0200

    meson: Remove check for vfork
    
    Nothing in spice-common calls vfork. The autotools-based build can
    fallback to vfork if fork is not available/working through the
    AC_FUNC_FORK macro, but the meson build is not implementing this magic.
    However, fork() is only called once in backtrace.h, and this part of the
    code is optional (it's not compiled in on Windows for example), and
    anyway, I doubt anyone is going to try to compile SPICE code on a
    platform without fork, so we can remove this check, it's always possible
    to readd it when we have a clear bug report about what is
    missing/needed.
    
    Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/meson.build b/meson.build
index 02ebbd8..cb8a1ee 100644
--- a/meson.build
+++ b/meson.build
@@ -58,8 +58,7 @@ headers = ['alloca.h',
            'sys/socket.h',
            'sys/stat.h',
            'sys/types.h',
-           'unistd.h',
-           'vfork.h']
+           'unistd.h']
 
 foreach header : headers
   if compiler.has_header(header)
@@ -75,8 +74,7 @@ functions = ['alloca',
              'floor',
              'fork',
              'memmove',
-             'memset',
-             'vfork']
+             'memset']
 
 foreach func : functions
   if compiler.has_function(func)
commit e95f05452a3f2fa21274453ebcab4c5b62b222e9
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Wed Jun 6 12:58:55 2018 +0200

    meson: Support auto/true/false for optional dependencies
    
    At the moment, missing optional dependencies will be silently ignored
    when the corresponding configuration flag is 'true', and won't be tested
    for when the flag is 'false'.
    In the autotools build, this corresponds respectively to
    --enable-foo=auto and --disable-foo.
    Having a way to get an error when the package is enabled but missing is
    quite desirable. f52247384 has some half-baked attempt at that, but this
    was supposed to be removed from the series. This causes errors when
    processing meson.build, breaking the meson build.
    This commit adds 'true'/'false'/'auto' in a proper way.
    
    Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/meson.build b/meson.build
index 9c12467..02ebbd8 100644
--- a/meson.build
+++ b/meson.build
@@ -117,22 +117,19 @@ endforeach
 #
 # 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 foeach block below.
+# for the dependency is done in the foreach block below.
 optional_deps = [
-                    ['celt051', '>= 0.5.1.1', false, 'HAVE_CELT051'],
-                    ['opus', '>= 0.9.14', true, 'HAVE_OPUS'],
+                    ['celt051', '>= 0.5.1.1', 'HAVE_CELT051'],
+                    ['opus', '>= 0.9.14', 'HAVE_OPUS'],
                 ]
 foreach dep : optional_deps
-  if get_option(dep[0])
-    deps += [dep]
-  endif
-endforeach
-
-foreach dep : deps
-  d = dependency(dep[0], required : dep[2], version : dep[1])
-  if d.found()
-    spice_common_deps += d
-    spice_common_config_data.set(dep[3], '1')
+  option_value = get_option(dep[0])
+  if option_value != 'false'
+    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')
+    endif
   endif
 endforeach
 
diff --git a/meson_options.txt b/meson_options.txt
index 9796833..6994d91 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -11,13 +11,15 @@ option('extra-checks',
     description : 'Enable extra checks on code (default=false)')
 
 option('celt051',
-    type : 'boolean',
-    value : false,
-    description: 'Enable celt051 audio codec (default=false)')
+    type : 'combo',
+    choices : ['true', 'false', 'auto'],
+    value : 'auto',
+    description: 'Enable celt051 audio codec (default=auto)')
 
 option('opus',
-    type : 'boolean',
-    value : true,
+    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