Meson build system release 1.1

The release of the Meson 1.1.0 build system has been published, which is used to build projects such as X.Org Server, Mesa, Lighttpd, systemd, GStreamer, Wayland, GNOME and GTK. The Meson code is written in Python and is licensed under the Apache 2.0 license.

The key development goal of Meson is to provide a high speed assembly process combined with convenience and ease of use. Instead of make, the build uses the Ninja toolkit by default, but other backends such as xcode and VisualStudio can also be used. The system has a built-in multi-platform dependency handler that allows you to use Meson to build packages for distributions. Assembly rules are set in a simplified domain-specific language, they are well readable and understandable to the user (according to the authors' idea, the developer should spend a minimum of time writing rules).

Cross-compiling and building on Linux, Illumos/Solaris, FreeBSD, NetBSD, DragonFly BSD, Haiku, macOS and Windows using GCC, Clang, Visual Studio and other compilers is supported. It is possible to build projects in various programming languages, including C, C++, Fortran, Java and Rust. An incremental build mode is supported, in which only components that are directly related to changes made since the last build are rebuilt. Meson can be used to generate repeatable builds, where running the build in different environments results in completely identical executables.

Main innovations of Meson 1.1:

  • A new "objects:" argument has been added to declare_dependency() to attach objects directly to executables as internal dependencies that do not require link_who.
  • The "meson devenv --dump" command has the optional ability to specify a file to write environment variables to, instead of outputting to the standard output stream.
  • Added the FeatureOption.enable_if and FeatureOption.disable_if methods to make it easier to create conditionals in preparation for passing parameters to the dependency() function. opt = get_option('feature').disable_if(not foo, error_message : 'Cannot enable feature when foo is not also enabled') dep = dependency('foo', required : opt)
  • It is allowed to pass generated objects among the "objects:" arguments.
  • The project function supports the installation of files with information about project licenses.
  • Executing "sudo meson install" ensures privilege reset during rebuild for target platforms.
  • The "meson install" command provides the ability to specify a separate handler for obtaining root permissions (for example, you can select polkit, sudo, opendoas or $MESON_ROOT_CMD). Running "meson install" in non-interactive mode no longer attempts to elevate privileges.
  • Added support for reading options from the meson.options file instead of meson_options.txt.
  • Provided redirection to stderr of the output of information about the progress of introspection.
  • A new "none" backend (--backend=none) has been added to create projects that have only install rules and no build rules.
  • A new dependency pybind11 has been added to make dependency('pybind11') work with pkg-config and cmake without using the pybind11-config script.
  • The "--reconfigure" and "--wipe" options (meson setup --reconfigure builddir and meson setup --wipe builddir ) are allowed with an empty builddir.
  • meson.add_install_script() added support for the dry_run keyword, which allows you to run your own installation scripts when calling "meson install --dry-run".

Source: opennet.ru

Add a comment