Skip to content
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

Document using nproc instead of hardcoded number of threads #4476

Merged
merged 10 commits into from
Dec 24, 2020
14 changes: 14 additions & 0 deletions development/compiling/compiling_for_linuxbsd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@ A good rule of thumb for the ``-j`` (*jobs*) flag, is to have at least as many
threads compiling Godot as you have cores in your CPU, if not one or two more.
Feel free to add the ``-j`` option to any SCons command you see below.

You can automatically use all available cores with command substitution.
Calinou marked this conversation as resolved.
Show resolved Hide resolved

On Linux you can use ``nproc``:
Calinou marked this conversation as resolved.
Show resolved Hide resolved

::

scons -j$(nproc)

On BSD you can use ``sysctl -n hw.ncpu``:
Calinou marked this conversation as resolved.
Show resolved Hide resolved

::

scons -j$(sysctl -n hw.ncpu)

.. note::

Prior to Godot 4.0, the Linux/\*BSD target was called ``x11`` instead of
Expand Down