Meson build system release 1.3

The release of the Meson 1.3.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.3:

  • Added the option “werror: true” to the compiler check methods compiler.compiles(), compiler.links() and compiler.run(), which treats compiler warnings as errors (can be used to check that the code is built without warnings).
  • Added has_define method to check symbol definition by preprocessor.
  • The macro_name parameter has been added to the configure_file() function, adding macro protection for double connections through “#include” (“include guards”), designed in the style of macros in the C language (simplifying the creation of configure files with dynamic macro names).
  • A new output format has been added to configure_file() - JSON (“output_format: json”).
  • Added the ability to use lists of values ​​to the c_std and cpp_std parameters (for example, “default_options: 'c_std=gnu11,c11′’).
  • In modules that use CustomTarget to process files, the ability to customize messages output by the ninja utility has been added.
  • The build_target "jar" has been deprecated and the "jar()" call is recommended instead.
  • The 'env' parameter has been added to the generator.process() method to set the environment variable through which the generator will process input.
  • When specifying build target names associated with executables, suffixes such as "executable('foo', 'main.c', name_suffix: 'bar')" are allowed to generate additional executables in the same directory.
  • Added the “vs_module_defs” parameter to the exectuable() function to use a def file that defines the list of functions passed to shared_module().
  • Added 'default_options' parameter to find_program() function to set default options for fallback subproject.
  • Added fs.relative_to() method, which returns the relative path for the first argument, relative to the second, if the first path exists. For example, "fs.relative_to('/prefix/lib', '/prefix/bin') == '../lib')".
  • The following_symlinks parameter has been added to the install_data(), install_headers() and install_subdir() functions; when set, symbolic links are followed.
  • A “fill” parameter has been added to the int.to_string() method to incrementally fill the string with leading zeros. For example, calling message(n.to_string(fill: 3)) for n=4 will produce the string "004".
  • Added a new target, clang-tidy-fix, that specifies running the clang-tidy utility with the "-fix" flag.
  • The ability to specify the suffix (TARGET_SUFFIX) of the assembly target ([PATH_TO_TARGET/]TARGET_NAME.TARGET_SUFFIX[:TARGET_TYPE]) has been added to the compile command.
  • Added environment variable MESON_PACKAGE_CACHE_DIR to override the path to the package cache (subprojects/packagecache), for example, allowing you to use a shared cache in several projects.
  • Added "meson setup --clearcache" command to clear persistent cache.
  • Support for the “required” keyword has been added to all “has_*” compiler check methods, for example, instead of “assert(cc.has_function('some_function'))” you can now specify “cc.has_function('some_function', required: true)”.
  • A new keyword, rust_abi, has been added to the shared_library(), static_library(), library(), and shared_module() functions, which should be used instead of the deprecated rust_crate_type.

Source: opennet.ru

Add a comment