I have a large cmake project, I want to build it using multiple cores because it takes a long time. I tried to do this by adding the “-j” flag to the settings as follows:
However, when I start building, only one core is being used. In task manager I see a single instance of “cc1plus.exe” using 25% of my cpu (=1 out of 4 cores) and no other processes doing significant work. How do I compile with multiple cores?
This could happen if your Makefile contained a target structure that cannot be easily parallelized. Also the MinGW Make has a bug that often hangs it when using multi-core mode. Our best advice would be to try switching the project to MSBuild. It’s not officially supported for MinGW/Cygwin projects, however if you add the ‘VisualGDB’ platform to the project and manually enter the toolchain location via VS project properties, VisualGDB should pick it up. MSBuild does not rely on Make for local builds, so it will work much faster. If it does not work, let us know and we will try to help.
Thanks, I tried MSBuild earlier but had trouble getting my code to compile there. I might ask later about that if I have the need.
Instead I replaced the “$(VISUALGDB_DIR)\make.exe” in the make command with “C:\msys64\usr\bin\make.exe” and now it is utilizing 100% of my cpu and seems to work fine.