Meson build system release 0.58. Project to create Meson implementation in C language

The release of the Meson 0.58 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 0.58:

  • The Meson language has built-in string formatting operations. Instead of calling the format method, you can now substitute values ​​directly, for example, instead of "'A string @0@ to be formatted @1@'.format(n, m)" you can immediately specify "f'A string @n@ to be formatted @ m@'".
  • The "replace" method has been added to string objects to perform the operation of replacing one substring with another, for example, "s = s.replace('aaa', 'bbb')".
  • Added "range(start, stop[, step])" function to return an object that can be used in a "foreach" loop, such as "foreach i : range(15)".
  • The meson.add_devenv() method has been implemented, allowing you to add an environment() object to set environment variables while using the "meson devenv" command, for example, to set an environment variable with the path to the plugins directory.
  • For development environments, a new command "meson devenv -C builddir [<command>]" is proposed, which makes it possible to run the command in an environment configured to run projects from the build directory (without installation).
  • By default, no "-pipe" option is passed when starting all supported compilers.
  • Allow meson.add_dist_script() to be called from subprojects.
  • Provided the ability to run the append() and prepend() methods multiple times on the same environment() object.
  • More than one space-separated argument is allowed in the error() function (similar to warning() and message()).
  • Added "--skip-subprojects" option to selectively skip installing subprojects.

Of particular note is the Boson project, aimed at creating a portable and simple implementation of the Meson assembly script language, written in C instead of Python. The project is still at the initial stage of development and is not yet ready for a full assembly of working projects. The code is distributed under the GPLv3 license (the original Python Meson comes under the Apache 2.0 license).

Source: opennet.ru

Add a comment