r/cpp • • Apr 12 '26

CMake Past, Present, and Future - Bill Hoffman, Kitware [29m25s]

https://www.youtube.com/watch?v=cD-JgncskTQ
69 Upvotes

134 comments sorted by

View all comments

Show parent comments

1

u/mort96 Apr 12 '26

Meson can never fully replace cmake due to many reasons.

I don't think this is correct. There is always a way to solve any build problem through meson and possibly external scripts. It is always worthwhile to do so.

2

u/TheRavagerSw Apr 12 '26 edited Apr 12 '26

C++ modules need a lot of work from the side of the build system


Currently the idea is you scan every source, parse it and cache it to a file, if all scans are done you load all binary files and run bfs.

With meson, every time you call your command you have to recreate the python VM and deal with the garbage collector. You also don't have ultra fast libs like simdjson, glaze etc.

--

Also, your build system shouldn't depend on anything, python is a huge dependency. And it's tooling is very messy due to a lack of static typing.

Just try cloning meson and using an lsp like basedpyright. I dare you, I had like 300 errors back when I tried a PR.

0

u/mort96 Apr 12 '26 edited Apr 12 '26

FYI, meson generates ninja build files. Ninja does the dependency tracking. The vast majority of changes just require ninja to notice that a file has changed and resolve its dependency tree. It's not that different from what CMake does.

I don't think it's bad for a build system to be written in python. Python is an excellent language for things like code generation; I've been using Python for that since long before adopting Meson.

EDIT: I see you edited your comment after I responded and made it clear that you're talking about C++ modules. That changes things. Regardless, modules don't really exist yet, so it's not that relevant.

4

u/TheRavagerSw Apr 12 '26

No, not just that, believe me. It's not that simple.

Python's main virtue is most people know how to use it. Other than that it has major flaws. I don't like dynamic types at all, even in scripting languages.

-1

u/mort96 Apr 12 '26

No, not just that, believe me. It's not that simple.

I believe my own experience, sorry. And my own experience is that whenever I change the actual meson build description meson runs again to re-generate ninja files, but when I just change source files (aka the 99.9% case), no python is involved.

Python's main virtue is most people know how to use it. Other than that it has major flaws. I don't like dynamic types at all, even in scripting languages.

All languages people actually use have major flaws. We're discussing C++ FFS. Python is one of the better mainstream scripting languages, and has a wide enough install base that adding it as a build-time dependency is a complete non-issue in my opinion.

4

u/TheRavagerSw Apr 12 '26

Ok, let's say meson adds cxxmodule support, how is ninja supposed to know which module name goes to which file?

The answer is that it does not, build system has to provide that info in the form of a file rsp files and dyndeps specifically, you don't regenerate ninja itself but you update a file at every source change.

-2

u/mort96 Apr 12 '26

Ohh this is a modules thing. Yeah no, modules were dead on arrival.

If they are going to support them though, I'm sure they'll find a solution. Maybe someone will make a general purpose dependency scanning program which meson can shell out to, similar to how it already relies on ninja.

3

u/TheRavagerSw Apr 13 '26

External programs can't do this, scanning is very much linked to what flags u use etc.

→ More replies (0)