Even if Meson is more "powerful", there are other build systems out there that are better options than either of these.
Even if Meson is more "powerful", there are other build systems out there that are better options than either of these.
Meson is much more than just a different DSL. What is the CMake standard option for toggling between library types? What is the CMake standard option for toggling lto? What is the CMake standard option for enabling sanitizers?
Meson standardizes so much behavior. I can go to any project and immediately be able to configure a build with the parameters that I want.
-DBUILD_SHARED_LIBS=<ON,OFF>
> What is the CMake standard option for toggling lto?
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=<ON,OFF>
> What is the CMake standard option for enabling sanitizers?
There isn't one, sadly. Though, you can set CXXFLAGS to configure whatever behaviour you want.
To clarify, I mean "better" for complex tasks. Build systems are just tools like any other, meaning they're good at some things, but bad at others. CMake (and Meson) are good for simpler build scenarios, but when you need complexity they're a poor choice. For that you're better off with scons, waf, bazel, ant, buck, gradle, etc.
> Meson is much more than just a different DSL. What is the CMake standard option for toggling between library types? What is the CMake standard option for toggling lto? What is the CMake standard option for enabling sanitizers?
> Meson standardizes so much behavior. I can go to any project and immediately be able to configure a build with the parameters that I want.
Again, my issue with Meson is that it doesn't bring anything substantially new to the table to justify it. Having a nicer DSL isn't enough, and having some built in toggles for common things isn't enough. The fact that you happen to be more comfortable with Meson doesn't make it objectively better than CMake. Figuring out how to enable LTO and sanitizers for a CMake project might take a few minutes of Googling at most.
A new dev who has never encountered either of these might instinctively prefer Meson's syntax, but the wiser decision is to learn the (vastly) more mature and prolific CMake, and then not have to worry about it. Time spent on the build system is time not spent on the project.
... and loads of extra dogma about how projects should be structured that don't match reality, paired with a rude and dismissive BDFL maintainer.
I like Meson's python-like language much better, though.
Ultimately, it doesn't make sense to worry too much about picking one or the other though.
I spent a ton of time adjusting toolchains and doing string handling, regex handling or command invocations with escapes, lists vs strings etc. in CMake.
Dnt get me started with options vs set in CMake and caching...
The waste of time was so massive and frustrating that I ended up moving to Meson.
It is working remarkably better.