This is a similar question: What does --target option mean in CMake?
but the answer there doesn't explain anything about "-- -j 8". What does it actually do?
This is a similar question: What does --target option mean in CMake?
but the answer there doesn't explain anything about "-- -j 8". What does it actually do?
The --
option means to pass the following options on to the native tool, probably make
. For make
, the -j
option means the number of simultaneous jobs to run:
-j [jobs], --jobs[=jobs]
Specifies the number of jobs (commands) to run simultaneously. If there is more than one -j option, the
last one is effective. If the -j option is given without an argument, make will not limit the number of
jobs that can run simultaneously.
This allows make
to use multiple processes to run different build steps at the same time, likely reducing build time.
The -j
option tells cmake
to run up to N
separate jobs at the same time.
From the cmake build options:
The maximum number of concurrent processes to use when building.
Normally, make will execute only one recipe at a time, waiting for it to finish before executing the next. However, the ‘-j’ or ‘--jobs’ option tells make to execute many recipes simultaneously.