qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
	Richard Henderson <richard.henderson@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [PULL v2 00/11] capstone + disassembler patch queue
Date: Sat, 3 Oct 2020 09:12:08 +0200	[thread overview]
Message-ID: <8156e2b2-241c-11b6-cf4b-0da4f59215db@redhat.com> (raw)
In-Reply-To: <CAFEAcA_kr5M+TbLDiYVMZbSMgpZE8fN+ae27rgOVkpOj2b9-xQ@mail.gmail.com>

On 02/10/20 22:37, Peter Maydell wrote:
> ../src/meson.build:753: WARNING: Trying to compare values of different
> types (bool, str) using ==.
> The result of this is undefined and will become a hard error in a
> future Meson release.
> Configuring config-host.h using configuration
> Program scripts/hxtool found: YES
> Program scripts/shaderinclude.pl found: YES
> Program scripts/qapi-gen.py found: YES
> Program scripts/qemu-version.sh found: YES
> Run-time dependency threads found: YES
> Program keycodemapdb/tools/keymap-gen found: YES
> Program scripts/decodetree.py found: YES

This can be rewritten like

-if capstone_opt == 'disabled'
-  capstone_opt = false
-elif capstone_opt in ['enabled', 'auto', 'system']
+if capstone_opt in ['enabled', 'auto', 'system']
   have_internal = fs.exists('capstone/Makefile')
   capstone = dependency('capstone', static: enable_static,
                         required: capstone_opt == 'system' or
                                   capstone_opt == 'enabled' and not have_internal)
   if capstone.found()
     capstone_opt = 'system'
   elif have_internal
     capstone_opt = 'internal'
   else
-    capstone_opt = false
+    capstone_opt = 'disabled'
   endif
 endif
 if capstone_opt == 'internal'

...
-summary_info += {'capstone':          capstone_opt}
+summary_info += {'capstone':          capstone_opt == 'disabled' ? false : capstone_opt}


That said, this also showed a bug which can be fixed like this:

-  have_internal = fs.exists('capstone/Makefile')
+  have_internal = fs.exists(meson.current_source_dir() / 'capstone/Makefile')

Paolo



      parent reply	other threads:[~2020-10-03  7:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02 16:51 [PULL v2 00/11] capstone + disassembler patch queue Richard Henderson
2020-10-02 16:51 ` [PULL v2 01/11] capstone: Convert Makefile bits to meson bits Richard Henderson
2020-10-02 20:37 ` [PULL v2 00/11] capstone + disassembler patch queue Peter Maydell
2020-10-02 22:54   ` Richard Henderson
2020-10-03  7:06   ` Paolo Bonzini
2020-10-03  9:21     ` Richard Henderson
2020-10-03  7:12   ` Paolo Bonzini [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=8156e2b2-241c-11b6-cf4b-0da4f59215db@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).