Skip to content

meson: autodetect Qt dependencies

Íñigo Huguet requested to merge ih/meson-qt-auto into main

Summary

Do not build the Qt examples by default, but only if the dependencies are met.

Also, this fixes some Gitlab-CI failures that happen when generating the tarball with make distcheck or meson dist.

Purpose

Configuring the build directory with meson often fails if you don't have meson: autodetect Qt dependencies

Configuring the build directory with meson often fails if you don't have the right Qt dependencies. As they are used only to build some examples, it is better to autodetect them and, if present, then build the examples but skip them otherwise.

Still accept forcing qt=true or qt=false as before.

Note that there is a option type called "feature" whose purpose is to support exactly this: features with enable/disable/auto possible values: https://mesonbuild.com/Build-options.html#features. However, they don't accept true/false values so scripts using qt=true/false would start failing. Since meson 0.60 the "deprecated" argument can be used for options (https://mesonbuild.com/Build-options.html#deprecated-options), but that's a too new version of meson.

Also, this fixes some Gitlab-CI failures that happen when generating the tarball with make distcheck or meson dist. This is because it tries to check that the tarball content can be configured and built, but it uses the default configurations so it was using qt=yes. Now it will use qt=auto, avoiding the failure.

Checklist

Please read https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/CONTRIBUTING.md before opening the merge request. In particular, check that:

  • the subject for all commits is concise and explicative
  • the message for all commits explains the reason for the change
  • the source is properly formatted
  • any relevant documentation is up to date
  • you have added unit tests if applicable
  • the NEWS file is updated when the change deserves to be mentioned, for example for new features, behavior changes, API deprecations, etc.

Merge request reports