Investigate using Meson build system alongside CMake

• Aug 2, 2016 - 02:30

Meson is a build system which is designed to solve the problems with existing build tools like make, automake, CMake, qmake, etc. It is designed to be fast and simple to use, and it can handle frameworks like Qt.

https://github.com/mesonbuild/meson
http://mesonbuild.com/
http://www.admin-magazine.com/HPC/Articles/The-Meson-Build-System

Highlights from the Meson presentation video on YouTube:

  1. Design goals: https://youtu.be/KPi0AuVpxLI?t=7m4s
  2. Best features kept from other build systems: https://youtu.be/KPi0AuVpxLI?t=11m57s
  3. Building a C++ project with Meson: https://youtu.be/KPi0AuVpxLI?t=17m16s
  4. Building a Qt project with Meson: https://youtu.be/KPi0AuVpxLI?t=20m33s
  5. Benchmarks (compiling GLib): https://youtu.be/KPi0AuVpxLI?t=21m45s
  6. Cross compiling: https://youtu.be/KPi0AuVpxLI?t=26m9s
  7. IDE compatibility: https://youtu.be/KPi0AuVpxLI?t=30m43s
  8. Solution to distribution/developer library war: https://youtu.be/KPi0AuVpxLI?t=33m4s

I'm writing this post to see if there is any interest in using Meson, or if there is anything that I should be aware of before I try to set it up. It would probably take a while to setup, so we would continue using CMake in the meantime and only make the switch once everything was ready.


Comments

Who's using Meson currently? The number one feature of such a system is perennity and in the early days the best metrics for perennity is who else is using it? Preferably big projects or teams.

The Qt project is developing QBS for years to replace qmake. QBS is integrated in Qt Creator by the same people. So if we would make a switch, it would be a strong candidate.

I can't find a list anywhere of who is using Meson, but here are a few that switched recently. The project looks very well maintained and unlikely to be neglected.

It seems that most of the performance benefits of Meson come from the fact it uses ninja as a backend instead of make, giving up to about 20% performance increase (or up to 50% on ARM!). Interestingly it appears that CMake supports generating build.ninja files instead of Makefiles - see my attempt to get it working here.

However, even if CMake can use Ninja to get the performance benefit there are plenty of other reasons to switch to Meson later, such as its ability to create portable binaries on any platform, including creating AppImages on Linux!

Do you still have an unanswered question? Please log in first to post your question.