Skip to content

Build more deps in parallel

Halla Rempt requested to merge work/rempt/parallel_deps_build into master

There are several ways to make cmake build external projects using -jsomething.

  • export CMAKE_BUILD_PARALLEL_LEVEL as an environment variable -> if this is the case, then if there is no explicitl BUILD_COMMAND definition in the project, the project will be built with the number of processes defined by this variable
  • pass -DSUBMAKE_JOBS to cmake: this is then passed to the explicitly defined BUILD_COMMAND, like BUILDCOMMAND (MAKE) -j{SUBMAKE_JOBS} (Note the brackets! $(MAKE) is defined by gnu make when running submake jobs. Using plain make gives errors about the subjob server?)
  • and now a new method, where if you don't pass anything, the trick from the ext_qt MacOS build to use the ProcessorCount CMake module to find the number of cores is used, and then SUBMAKE_JOBS is set.

Not all ext_projects can use the first method, sometimes you have to define the BUILD_COMMAND.

Problems:

  • In my test qtx11extras wasn't built -- don't know why. I had to go into the src folder, run qmake and install it manually
  • I'm still seeing some messages about jobservers being restarted or something like "warning: jobserver unavailable: using -j1. Add '+' to parent make rule"

Testing:

  • I've only tested this on Linux. I'll test on macOS later on, but I don't have a working Windows system at the moment.

Merge request reports

Loading