Preferences

Another thing that's interesting lately is that CMake has decided that Makefiles are unfit for projects that use C++20 modules, and ninja is the way to go. [1]

Basically it's considered too hard if not impossible to statically define the target's dependencies. This is now done dynamically with tools like `clang-scan-deps` [2]

[1] https://cmake.org/cmake/help/latest/manual/cmake-cxxmodules....

[2] https://llvm.org/devmtg/2019-04/slides/TechTalk-Lorenz-clang...


wahern
Correct me if I'm wrong, but I think this limitation wrt Makefiles is entirely a choice by CMake, or at least a lack of volunteers for adding support to the Makefile generator. Ninja itself doesn't have any support for C++ modules (see https://github.com/ninja-build/ninja/issues/2457). In fact, Ninja has fewer features in that regard than plain Make as Ninja requires all dependencies to be statically defined.
nrclark
Modules are a disaster tbh.
can you expand on that?
nrclark
Yes. They were approved for C++20 with no working reference implementation. This was done over objections from representatives from every compiler and build system. 5 years later they're still not widely (or fully) implemented.

They're impossible to implement in Make, which is without exaggeration the world's most widely-used build tool. Even CMake has had a very difficult time implementing them. They break most methods for incremental builds, and mean that a compiler is needed just to determine staleness. They also make fully parallelized compilation impossible, because dependencies can't be fully resolved by the build system.

alextingle
If you can't easily reason about dependencies, then your builds will just get more and more bloated.

People who care about build systems are a special kind of nerd. Programmers are often blissfully ignorant of what it takes to build large projects - their experience is based around building toy projects, which is so easy it doesn't really matter what you do.

In my experience, once a project has reached a certain size, you need to lay down simple rules that programmers can understand and follow, to help them from exploding the build times. Modules make that extra hard.

skydhash
These days I like system paths for deps more and more. You just need to specify the paths and everything that is in there can be included in the project. But gradle shenanigans where the dependency graph is built by some obscure logic is not to my liking.
monkeyelite
Nobody implemented them except Msft

This item has no comments currently.