Meson — a new build system

Better Builder

© Lead Image © tommroch,

© Lead Image © tommroch,

Article from Issue 166/2014

Developers fed up with cryptic Makefiles should take a look at the new Meson build system, which is simple to operate, offers scripting capabilities, integrates external test tools, and supports Linux, Windows, and Mac OS X.

Finnish developer Jussi Pakkanen was frustrated by existing build systems with foolish syntax in configuration files and unexpected behavior [1]. During the Christmas season of 2012, he therefore decided to develop his own build system that would run fast, be reliable and easy to use, run on all major operating systems, and integrate important test tools like Valgrind.Just two months later, Pakkanen published a first version of his build system, which, as a trained physicist, he named for the Meson particle. Since then, the technology has advanced quickly. Version 0.17.0 – the latest version when this article was written – is already extremely stable despite its low version number and contains all the features planned by the program author.

Meson builds executables and libraries and supports multiple directories for different builds from the same source. The flexible configuration language is easy to learn, opens many possibilities to the developer, and supports if statements.

Presentable Features

Meson is written entirely in Python 3 and is released under Apache License 2.0. One minor drawback, however, is that, currently, Meson can only handle source code in the programming languages, C, C++, Java, and Vala. Meson does not bundle the source code into the appropriate compiler itself; rather, it simply generates configuration files for an existing build system. Under Linux, Meson generates build files for the relatively unknown but quite nimble Ninja [2] mini-build system. Alternatively, Meson outputs project files for Visual Studio 2010 or Xcode. Meson refers to all of these external tools as back ends.


Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Qmake for Qt

    Qt’s own build system Qmake is often overlooked for larger projects, but many experienced developers appreciate Qmake support for shadow builds and pre- or post-build dependencies.

  • Kotlin Programming Language

    Kotlin, a small island in the Gulf of Finland, is also the name of a new programming language that aims to become a modern alternative to Java.

  • DotGNU

    Write C# programs in Linux with the free and vendor-neutral DotGNU.

  • SHC: Bash Script Compiler

    The Bash Shell Script Compiler converts shell scripts directly into binaries. Compiling your scripts provides protection against accidental changes, but you will have to contend with some quirks.

  • strace

    Get started with strace by examining a pair of "Hello World" programs. Next month, in the second part of this two-part series, I'll take a deeper look at strace output.

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95