All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Gnatenko <ignatenko@redhat.com>
To: dri-devel@lists.freedesktop.org
Cc: Igor Gnatenko <ignatenko@redhat.com>
Subject: [PATCH libdrm] meson: do not use cairo/valgrind if disabled
Date: Mon, 19 Feb 2018 13:55:27 +0100	[thread overview]
Message-ID: <20180219125527.8167-1-ignatenko@redhat.com> (raw)
In-Reply-To: <20180219121516.mcyn6cfmvkgpy7qj@imgtec.com>

-Dcairo-tests=false currently results into enabling cairo support if it
was found. Same for valgrind.

v2:
* Use underscore-prefixed variables to not change type of variable
* Use empty array for "fake" dependency instead of real empty object

v3:
* Fix typo

Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
---
 meson.build | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/meson.build b/meson.build
index 166559e8..7f786a8c 100644
--- a/meson.build
+++ b/meson.build
@@ -32,8 +32,6 @@ pkg = import('pkgconfig')
 with_udev = get_option('udev')
 with_freedreno_kgsl = get_option('freedreno-kgsl')
 with_install_tests = get_option('install-test-programs')
-with_cairo_tests = get_option('cairo-tests')
-with_valgrind = get_option('valgrind')
 
 config = configuration_data()
 
@@ -226,8 +224,22 @@ endforeach
 
 dep_pciaccess = dependency('pciaccess', version : '>= 0.10', required : with_intel)
 dep_cunit = dependency('cunit', version : '>= 2.1', required : false)
-dep_cairo = dependency('cairo', required : with_cairo_tests == 'true')
-dep_valgrind = dependency('valgrind', required : with_valgrind == 'true')
+_cairo_tests = get_option('cairo-tests')
+if _cairo_tests != 'false'
+  dep_cairo = dependency('cairo', required : _cairo_tests == 'true')
+  with_cairo_tests = dep_cairo.found()
+else
+  dep_cairo = []
+  with_cairo_tests = false
+endif
+_valgrind = get_option('valgrind')
+if _valgrind != 'false'
+  dep_valgrind = dependency('valgrind', required : _valgrind == 'true')
+  with_valgrind = dep_valgrind.found()
+else
+  dep_valgrind = []
+  with_valgrind = false
+endif
 
 with_man_pages = get_option('man-pages')
 prog_xslt = find_program('xsltproc', required : with_man_pages == 'true')
@@ -259,8 +271,8 @@ foreach t : [
              [with_radeon, 'RADEON'],
              [with_vc4, 'VC4'],
              [with_vmwgfx, 'VMWGFX'],
-             [dep_cairo.found(), 'CAIRO'],
-             [dep_valgrind.found(), 'VALGRIND'],
+             [with_cairo_tests, 'CAIRO'],
+             [with_valgrind, 'VALGRIND'],
             ]
   config.set10('HAVE_@0@'.format(t[1]), t[0])
 endforeach
-- 
2.16.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      parent reply	other threads:[~2018-02-19 12:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180218130050.17679-1-ignatenko@redhat.com>
2018-02-19 12:15 ` [PATCH libdrm] meson: do not use cairo/valgrind if disabled Eric Engestrom
2018-02-19 12:50   ` Igor Gnatenko
2018-02-19 12:51   ` Igor Gnatenko
2018-02-19 12:55   ` Igor Gnatenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180219125527.8167-1-ignatenko@redhat.com \
    --to=ignatenko@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.