We have been using Conan to build most of our dependencies for some time now. It works great but when we update one of the dependency to the latest version, Conan recompiles it using a single core and this can take quite some time on my laptop.
How can I do the compilation using all the cores my machine has ?
A general answer would be appreciated but if any specific hack exists for windows, I would be happy too.
Currently my command line looks like this:
conan install "C:/Conan/Conan.txt" --build "missing" -s "build_type=Debug" -s "compiler.runtime=MTd"
It looks like I am missing some magic incantation like -s compiler.multithread=true
, but I cannot find any example of this issue anywhere in the doc and Google didn't help either.
By default, Conan 2.x should use all cores available in your machine as the number of jobs, but in case you want to directly say how many jobs should be used, you can set it directly in Conan configuration:
tools.build:jobs: Default compile jobs number -jX Ninja, Make, /MP VS (default: max CPUs)
https://docs.conan.io/2/reference/config_files/global_conf.html#introduction-to-configuration
So, you can add it directly to your profile:
[settings]
os=Windows
...
[conf]
tools.build:jobs=8
Or, you can pass it directly by command line (it will override the value from your profile):
conan install conanfile.txt -c tools.build:jobs=4 --build=missing