-
Notifications
You must be signed in to change notification settings - Fork 989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] MsBuild tools.microsoft.msbuild:max_cpu_count #17290
Comments
Hi @fellinga Thanks for your question.
It is not clear if you are using MSBuild (VS native project) or via CMake. In any case, note that you can also use the
Not really, if the solution doesn't have multiple projects to build in parallel. For intra-project compilation parallelism, you need the above njobs = conanfile.conf.get("tools.build:jobs",
default=_cpu_count(),
check_type=int) This is how the default number of jobs is computed, by default it is already the I see it seems there is a small bug in the |
One thing more: the |
Hi @memsharded, thanks for answering so quickly! We use MSBuild with VisualStudio and do not use CMake at all. I'll try to explain my issue a little better, sorry if it was not clear enough:
to our conanfiles. Now when i call "conan install . " it generates "MSBuild.exe mySolution.sln /p:Configuration=Release" which is almost exactly what we want besides the missing maxcpucount argument. I do not want to specify a hardcoded number of cores since my CI runners do not all have the same amount of CPUs. How can we solve this issue? Thanks! |
Understood. Yes, I think this specific use case is not covered by the current Thanks for the feedback! |
Proposing #17301, and the |
#17301 was merged, so using |
Hello,
we are using conan in CI/CD and we were wondering if we can utilize all of the CPUs in a MsBuild build when calling "conan build .".
We already know that we can mimic /maxcpucount:2 with tools.microsoft.msbuild:max_cpu_count=2 in our default.conf file, but how can we set /maxcpucount without any arguments? Because setting /maxcpucount would use all available CPUs by default... "If you include the -maxcpucount switch without specifying a value, MSBuild will use up to the number of processors on the computer." (source).
Another question: is there a better way to set tools.microsoft.msbuild:max_cpu_count=2 in CI/CD besides manually appending it to the default.conf?
Thanks in advance!
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: