From 5cfdce49abfc495d31cf6dc5c8deedee4404e5ba Mon Sep 17 00:00:00 2001 From: Enhex Date: Thu, 24 Dec 2020 15:49:02 +0200 Subject: [PATCH] Document using `nproc` instead of hardcoded number of threads (#4476) Co-authored-by: Hugo Locurcio --- development/compiling/compiling_for_linuxbsd.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/development/compiling/compiling_for_linuxbsd.rst b/development/compiling/compiling_for_linuxbsd.rst index 6f8f01a75..688359faa 100644 --- a/development/compiling/compiling_for_linuxbsd.rst +++ b/development/compiling/compiling_for_linuxbsd.rst @@ -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 CPU cores with command substitution. + +On Linux, you can use ``nproc``: + +:: + + scons -j$(nproc) + +On \*BSD, you can use ``sysctl -n hw.ncpu``: + +:: + + scons -j$(sysctl -n hw.ncpu) + .. note:: Prior to Godot 4.0, the Linux/\*BSD target was called ``x11`` instead of