It seems parallelism is requested for make check
target when building with CMake and the “Unix Makefiles” generator which is the default on Linux and macOS. See:
13:53 < sipa>
make -j check
doesn’t actually parallellize in the cmake build, which is a bit unfortunate
Is
make check
being run with multiple jobs? I assume not
With this PR, it is possible to build like that:
0cmake -S . -B build
1make -C build -j $(nproc)
2make check -C build -j $(nproc)
Making this PR a draft as it seems low priority and the diff seems a bit hackish.
My personal preference is to use the CMake’s native ctest
command :)
Anyway, this PR fixes an item in #1235.
UPD. Here is a couple of alternative approaches:
- set the
CTEST_PARALLEL_LEVEL
environment variable:
0export CTEST_PARALLEL_LEVEL=$(nproc)
- use the
test
target and (undocumented)ARGS
variable:
0make test -C build ARGS=-j$(nproc)