The Meson Build system (2024)

Overview

Meson is an open source build system meant to be both extremely fast,and, even more importantly, as user friendly as possible.

The main design point of Meson is that every moment a developer spendswriting or debugging build definitions is a second wasted. So is everysecond spent waiting for the build system to actually start compilingcode.

Features

  • multiplatform support for Linux, macOS, Windows, GCC, Clang, Visual Studio and others
  • supported languages include C, C++, D, Fortran, Java, Rust
  • build definitions in a very readable and user friendly non-Turing complete DSL
  • cross compilation for many operating systems as well as bare metal
  • optimized for extremely fast full and incremental builds without sacrificing correctness
  • built-in multiplatform dependency provider that works together with distro packages
  • fun!

Quickstart for beginners

Are you an absolute beginner when it comes to programming? No worries,read this beginner guide to get started.

Community

The easiest way for most people to connect to other Meson developers isa web chat. The channel to use is #mesonbuild either via Matrix (webinterface) orOFTC IRC.

Other methods of communication include the mailinglist (hosted byGoogle Groups) and theDiscussions sectionof the Meson GitHub repository.

Projects using Meson

Many projects are using Meson and they'rea great resource for learning what to (and what not to!) do whenconverting existing projects to Meson.

A short list of Meson users can be found herebut there are many more. We would love to hear about your successstories too and how things could be improved too!

Development

All development on Meson is done on the GitHubproject. Instructions forcontributing can be found on the contribution page.

You do not need to sign a CLA to contribute to Meson.

Subpages:

The Absolute Beginner's Guide to Installing and Using Meson– Simple getting started guide

Getting Meson

Quickstart Guide– Getting Started using Mesonbuild

Tutorial– Simplest tutorial

Building a simple SDL2 app from scratch– A simple GUI tutorial

Manual– User manual for Meson

Reference manual– The Meson reference manual

Reference tables

Style recommendations– Style recommendations for Meson files

Meson file rewriter– Automatic modification of the build system files

FAQ

Reproducible builds

How do I do X in Meson?

Meson WrapDB packages

Wrap dependency system manual

Release notes

Additional documentation– Misc documentation

Contributing to Meson– Contributing to Meson

Legal information

Videos– Videos about Meson

The results of the search are

Website licensing information are available on the Legal page.

The Meson Build system (2024)

FAQs

Is Meson a good build system? ›

The best thing about Meson Build System is the fact that it is easy to use quickly. It supports Linux, MacOS, Windows operating systems apart from multiple compilers. Meson do not allow you to build code in same folder as the source, which is great as well.

How does Meson build work? ›

Meson is different from some other build systems in that it does not permit in-source builds. You must always create a separate build directory. Common convention is to put the default build directory in a subdirectory of your top level source directory. When Meson is run it prints the following output.

What does Meson build by default? ›

The Meson default is to produce a debug build with binaries compiled with debug symbols and, when compiling with MSVC, linking to the Visual Studio debug runtime, see below.

How do you compile in Meson build? ›

To compile any given configuration, just go into the corresponding build directory and run meson compile . Meson will automatically add compiler flags to enable debug information and compiler warnings (i.e. -g and -Wall ). This means the user does not have to deal with them and can instead focus on coding.

What are the advantages of meson? ›

Pros. The fastest build system see measurements, user friendly, designed to be as invisible to the developer as possible, native support for modern tools (precompiled headers, coverage, Valgrind etc).

How long does a meson last? ›

All mesons are unstable, with lifetimes ranging from 108 second to less than 1022 second. They also vary widely in mass, from 140 megaelectron volts (MeV; 106 eV) to nearly 10 gigaelectron volts (GeV; 109 eV).

Where does Meson install? ›

There is usually no need to specify install paths or the like. Meson will automatically install it to the standards-conforming location. In this particular case the executable is installed to the bin subdirectory of the install prefix.

What languages does Meson support? ›

Being written in Python, Meson runs on Unix-like operating systems, including macOS, as well as Microsoft Windows and on other operating systems. Meson supports the C, C++, CUDA, D, Objective-C, Fortran, Java, C#, Rust, and Vala languages, and has a mechanism for handling dependencies called Wrap.

What are the target options for Meson? ›

Meson provides four kinds of build targets: executables, libraries (which can be set to be built as static or shared or both of them at the build configuration time), static libraries, and shared libraries. They are created with the commands executable , library , static_library and shared_library , respectively.

What is the purpose of meson? ›

Mesons are also used to study the structure of the nucleus, and they can be used to produce other particles, such as neutrinos. Here are some specific examples of the uses of mesons: 1. Studying the strong force: The strong force is the force that binds quarks together to form protons, neutrons, and other hadrons.

Where does Meson look for dependencies? ›

Meson can use the CMake find_package() function to detect dependencies with the builtin Find<NAME>. cmake modules and exported project configurations (usually in /usr/lib/cmake ).

What is meson command? ›

Meson uses out of source builds. Hint: The syntax of Meson is meson [command] [arguments] [options] . The setup command takes a builddir and a srcdir argument. If no srcdir is given Meson will deduce the srcdir based on pwd and the location of meson. build .

How to install Meson python? ›

Meson is available in the Python Package Index and can be installed with pip3 install --user meson . This does not require any special privileges. This will install the package in ~/. local/ , so you will have to add ~/.

How to compile a project in Visual Studio? ›

Select the configuration (Debug or Release) and platform (x86, x64, etc.) you want to build for from the toolbar. Click on the "Build" menu and select "Build Solution" or press the F6 key. Visual Studio will compile your project and generate an executable file (usually with a .exe extension) in the output directory.

Why is meson unstable? ›

Because a meson consists of a particle and an antiparticle, it is very unstable.

Does meson use ninja? ›

Meson supports GNU Compiler Collection, Clang, Microsoft Visual C++ and other compilers, including non-traditional compilers such as Emscripten and Cython. The project uses ninja as the primary backend buildsystem, but can also use Microsoft Visual Studio or Xcode backends.

Why is Ninja better than make? ›

In essence, Ninja is meant to replace Make, which is slow when performing incremental (or no-op) builds. This can considerably slow down developers working on large projects, such as Google Chrome which compiles 40,000 input files into a single executable. In fact, Google Chrome is a main user and motivation for Ninja.

What are the three types of meson? ›

The most common type of mesons are the pions (pi mesons), kaons (K mesons) and the eta meson (η-meson). These are also the only types of meson that are long-lived enough to be seen directly by their tracks in a detector.

Top Articles
Latest Posts
Article information

Author: Mr. See Jast

Last Updated:

Views: 6202

Rating: 4.4 / 5 (75 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Mr. See Jast

Birthday: 1999-07-30

Address: 8409 Megan Mountain, New Mathew, MT 44997-8193

Phone: +5023589614038

Job: Chief Executive

Hobby: Leather crafting, Flag Football, Candle making, Flying, Poi, Gunsmithing, Swimming

Introduction: My name is Mr. See Jast, I am a open, jolly, gorgeous, courageous, inexpensive, friendly, homely person who loves writing and wants to share my knowledge and understanding with you.