Conan Version: 1.18.4
I just upgraded some of our projects to build with ninja by setting CONAN_CMAKE_GENERATOR=Ninja. While everything still works, this change caused quite a high load on the CI runner that I was not really expecting.
In particular, it seems like the cmake helper is ignoring the configured CONAN_CPU_COUNT value when the ninja generator is used. See:
I would expect that also the ninja generator adheres to the specified cpu count.
Hi @niosHD ,
Maybe you could add custom arguments for the CMake build using something like this in the conanfile.py:
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build(args=["--", "-j1"])
To reduce number of maximum commands you want Ninja to run in parallel.
Please tell us if this helps :)
Hi @niosHD
Yes, this makes sense, the Ninja generator is not receiving any parallel argument, only Makefiles and Visual. This should be added, thanks for pointing this out.