首页 > 解决方案 > cmake命令中--j 8是什么意思

问题描述

这是一个类似的问题:CMake 中的 --target 选项是什么意思?

但那里的答案没有解释任何关于“--- -j 8”的内容。它实际上是做什么的?

标签: cmake

解决方案


--选项意味着将以下选项传递给本机工具,可能是make. 对于make,该-j选项表示同时运行的作业数:

-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.

这允许make使用多个进程同时运行不同的构建步骤,可能会减少构建时间。


推荐阅读