summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBond-009 <Bond-009@users.noreply.github.com>2017-06-16 14:06:48 +0200
committerLukas Pioch <lukas@zgow.de>2017-06-16 14:06:48 +0200
commit49e015b8de3727910e215079a8a3941098e71c23 (patch)
tree09c9decad3fa6d751380ced7b7f2f26fa4707bfd
parentChange error no data to no name (diff)
downloadcuberite-49e015b8de3727910e215079a8a3941098e71c23.tar
cuberite-49e015b8de3727910e215079a8a3941098e71c23.tar.gz
cuberite-49e015b8de3727910e215079a8a3941098e71c23.tar.bz2
cuberite-49e015b8de3727910e215079a8a3941098e71c23.tar.lz
cuberite-49e015b8de3727910e215079a8a3941098e71c23.tar.xz
cuberite-49e015b8de3727910e215079a8a3941098e71c23.tar.zst
cuberite-49e015b8de3727910e215079a8a3941098e71c23.zip
-rwxr-xr-xcompile.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/compile.sh b/compile.sh
index 05a83db04..5076be7fe 100755
--- a/compile.sh
+++ b/compile.sh
@@ -56,7 +56,7 @@ errorArguments ()
echo "options:"
echo " -m The compilation mode. Either \"Release\" or \"Debug\". Defaults to \"$DEFAULT_BUILDTYPE\""
echo ' -t The number of threads to use for compiling'
- echo ' If unspecified, a "smart guess" is attempted (Currently simply picks 2)'
+ echo ' If unspecified, a "smart guess" is attempted'
echo ' -b The branch to compile. (Currently unused and pinned to MASTER)'
echo ' -n Prevent interactive mode'
echo ' -d Dry run. Print the chosen settings and exit'
@@ -361,7 +361,13 @@ fi
autoChooseThreads()
{
- echo "$DEFAULT_THREADS" # Todo choose based on system info, and fallback to DEFAULT_THREADS.
+ KERNEL=$(uname -s)
+
+ if [ "$KERNEL" = "Linux" ] || [ "$KERNEL" = "Darwin" ]; then
+ echo $(getconf _NPROCESSORS_ONLN)
+ else
+ echo "$DEFAULT_THREADS"
+ fi
}
if [ $STATE_INTERACTIVE -eq 1 ]; then