Hi C++ modules fans,
I have a couple of repositories that are now completely C++ modules based, using a cmake/ninja build system.
My best example is this maths library: GitHub - sebsjames/maths: C++ modules for scalar, vector and complex math. And maths. · GitHub
This library contains multiple test programs that I can compile and run with ctest. There are about 100 short test programs.
One result of using a C++ modules build process is that each executable that uses ‘moduleA.cppm’ will compile its own copy of moduleA. This means that I have to compile moduleA multiple times, conferring a compute penalty (which I can live with; it’s part of the design of modules). However, it also means that there are many temporary build files created, conferring a storage penalty. It turns out that after building all the tests for this relatively small library, about 18 GB of build files accumulate! With a modules build, building all the tests consumes absurd amount of storage · Issue #132 · sebsjames/maths · GitHub
My question is whether CMake has some kind of semi-cleanup process, that would allow me to keep just the binaries for the many test programs, but get rid of temporary build files as the build processes, keeping the disk usage relatively small?