From 72d9dbb3b007b0a4b1e099b557a17b1f6c4006c0 Mon Sep 17 00:00:00 2001 From: Jack Slater <903791+NuclearMonster@users.noreply.github.com> Date: Sun, 31 Aug 2025 00:53:01 -1000 Subject: [PATCH] First attempt at updating server_compile.sh for CMake for https://github.com/ioquake/ioq3/issues/786 --- misc/linux/server_compile.sh | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/misc/linux/server_compile.sh b/misc/linux/server_compile.sh index c116149e..1c3a416d 100644 --- a/misc/linux/server_compile.sh +++ b/misc/linux/server_compile.sh @@ -2,17 +2,17 @@ set -e -export BUILD_CLIENT="${BUILD_CLIENT:-0}" -export BUILD_SERVER="${BUILD_SERVER:-1}" -export USE_HTTP="${USE_HTTP:-1}" -export USE_CODEC_OPUS="${USE_CODEC_OPUS:-1}" -export USE_VOIP="${USE_VOIP:-1}" +export DBUILD_CLIENT="${DBUILD_CLIENT:-0}" +export DBUILD_SERVER="${DBUILD_SERVER:-1}" +export DUSE_HTTP="${DUSE_HTTP:-1}" +export DUSE_CODEC_OPUS="${DUSE_CODEC_OPUS:-1}" +export DUSE_VOIP="${DUSE_VOIP:-1}" export COPYDIR="${COPYDIR:-~/ioquake3}" IOQ3REMOTE="${IOQ3REMOTE:-https://github.com/ioquake/ioq3.git}" -MAKE_OPTS="${MAKE_OPTS:--j2}" +CMAKE_OPTS="${CMAKE_OPTS:-}" -if ! [ -x "$(command -v git)" ] || ! [ -x "$(command -v make)" ]; then - echo "This build script requires 'git' and 'make' to be installed." >&2 +if ! [ -x "$(command -v git)" ] || ! [ -x "$(command -v cmake)" ]; then + echo "This build script requires 'git' and 'cmake' to be installed." >&2 echo "Please install them through your normal package installation system." >&2 exit 1 fi @@ -20,7 +20,7 @@ fi echo " This build process requires all of the ioquake3 dependencies necessary for an ioquake3 server. If you do not have the necessary dependencies the build will fail. - Please post a message to http://discourse.ioquake.org/ asking for help and include whatever error messages you received during the compile phase. + Please post a message to https://discourse.ioquake.org/ asking for help and include whatever error messages you received during the compile phase. We will be building from the git repo at ${IOQ3REMOTE} The resulting binary will be installed to ${COPYDIR} @@ -38,8 +38,15 @@ while true; do [Yy]*) git clone $IOQ3REMOTE $BUILD_DIR/ioq3 cd $BUILD_DIR/ioq3 - make $MAKE_OPTS - make copyfiles + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_CLIENT="$DBUILD_CLIENT" \ + -DBUILD_SERVER="DBUILD_SERVER" \ + -DUSE_HTTP="$DUSE_HTTP" \ + -DUSE_CODEC_OPUS="$USE_CODEC_OPUS" \ + -DUSE_VOIP="$USE_VOIP" \ + $CMAKE_OPTS + cmake --build build + cmake copyfiles exit ;; [Nn]*)