[Mesa-dev] [PATCH kmscube 3/3] meson build support (v2)

Daniel Stone daniel at fooishbar.org
Mon Mar 27 11:08:05 UTC 2017


Hey Rob,

On 26 March 2017 at 14:59, Rob Clark <robdclark at gmail.com> wrote:
> Figured I should figure out what this meson stuff is all about.  After a
> bit of hunting around to find examples to look at (and interruptions) it
> took maybe ~1hr to convert (for someone who never looked at meson
> before).  The build speed is definitely faster even after Emil's auto-
> tools improvements:

Great! :)

> @@ -0,0 +1,48 @@
> +project('kmscube', 'c', default_options: [
> +       'c_std=c99',
> +       'buildtype=debugoptimized'
> +])
> +
> +# Maybe some of these could be default_options?  I couldn't find
> +# a good list of what options are supported.
> +add_global_arguments('-O0', language: 'c')

debugoptimized + -O0? Heh. Just remove this: --buildtype=debug will
set -O0 -g (or equivalent), debugoptimized will get you -g -O2, and
there's plain/release as well. More here:
https://github.com/mesonbuild/meson/wiki/Running-Meson

> +add_global_arguments('-Wall', language: 'c')
> +add_global_arguments('-Wextra', language: 'c')

Remove these, put 'warning_level=2' in default_options. You can also
build with --werror to do exactly what you'd imagine it does.

> +gst = dependency('gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-app-1.0 gstreamer-allocators-1.0 gstreamer-video-1.0 glib-2.0')
> +if gst.found()

You need to put 'required: false' as an argument to dependency(),
otherwise it fails when not found; the default is that deps are
required, even if you later call .found() on them. (I typed out the
code to make this kind of always-true codeblock illegal as it's
misleading - which took almost no time at all - but realised it banned
entirely legitimate usage. Sent a PR upstream, will see where it lands
but I assume I'll just abandon it. Oh well.)

Distributors will also want you to make gstreamer an option rather
than auto, so they can explicitly configure it.

The rest looks good!

Cheers,
Daniel


More information about the mesa-dev mailing list