build.cfg: Add BUILD_CLANG option. Set this to 1 if you're having issues with WS/VMAP and recent versionf of GCC.

This commit is contained in:
Marco Cawthorne 2022-05-05 09:13:16 -07:00
parent c5b2107abf
commit 32ae91d54f
Signed by: eukara
GPG Key ID: C196CD8BA993248A
4 changed files with 51 additions and 10 deletions

View File

@ -36,3 +36,6 @@ BUILD_ENGINEREVISION=6235
# Whether or not to run 'git pull' or 'svn up' before building a component
BUILD_UPDATE=1
# If we should try to use CLANG instead of GCC (Linux only)
BUILD_CLANG=0

View File

@ -49,8 +49,14 @@ then
else
WS_CFLAGS="$WS_CFLAGS"
WS_LDFLAGS="$WS_LDFLAGS -ldl"
WS_CC=gcc
WS_CXX=g++
if [ "$BUILD_CLANG" = "1" ]; then
WS_CC=clang
WS_CXX=clang++
else
WS_CC=gcc
WS_CXX=g++
fi
fi
mkdir -p ./bin

View File

@ -26,6 +26,21 @@ else
BUILD_PROC=$(nproc)
fi
# Compiler choice
if [ "$COMPILE_SYS" = "OpenBSD" ]
then
ENGINE_CC=cc
ENGINE_CXX=c++
else
if [ "$BUILD_CLANG" = "1" ]; then
ENGINE_CC=clang
ENGINE_CXX=clang++
else
ENGINE_CC=gcc
ENGINE_CXX=g++
fi
fi
if [ "$BUILD_DEBUG" -eq 1 ]
then
MAKETARGET=gl-dbg
@ -107,24 +122,25 @@ fi
if [ "$BUILD_ENGINE_DEPENDENCIES" -eq 1 ]
then
gmake -j $BUILD_PROC makelibs FTE_TARGET=$PLATFORM
CC=$ENGINE_CC CXX=$ENGINE_CXX gmake -j $BUILD_PROC makelibs FTE_TARGET=$PLATFORM
printf "Built the static dependencies successfully.\n\n"
fi
gmake -j $BUILD_PROC $MAKETARGET CFLAGS=-DMULTITHREAD FTE_TARGET=$PLATFORM
CC=$ENGINE_CC CXX=$ENGINE_CXX gmake -j $BUILD_PROC $MAKETARGET CFLAGS=-DMULTITHREAD FTE_TARGET=$PLATFORM
cp -v "$OUTPUT" ../../../bin/fteqw
printf "Built the client engine successfully.\n\n"
gmake -j $BUILD_PROC sv-dbg
CC=$ENGINE_CC CXX=$ENGINE_CXX gmake -j $BUILD_PROC sv-dbg
cp -v ./debug/fteqw-sv ../../../bin/fteqw-sv
printf "Built the dedicated server successfully.\n\n"
gmake -j $BUILD_PROC qcc-rel
CC=$ENGINE_CC CXX=$ENGINE_CXX gmake -j $BUILD_PROC qcc-rel
cp -v ./release/fteqcc ../../../bin/fteqcc
printf "Built the QuakeC compiler successfully.\n\n"
if [ "$BUILD_IMGTOOL" -eq 1 ]
then
# Note: DOESN'T LIKE CLANG!
gmake -j $BUILD_PROC imgtool-rel
cp -v ./release/imgtool ../../../bin/imgtool
printf "Built the imgtool successfully.\n\n"
@ -132,6 +148,7 @@ fi
if [ "$BUILD_SOURCE" -eq 1 ]
then
# Note: DOESN'T LIKE CLANG!
gmake -j $BUILD_PROC plugins-rel CFLAGS=-DGLQUAKE NATIVE_PLUGINS="hl2"
find ./release/ -name 'fteplug_hl2_*.so' -exec cp -prv '{}' '../../../bin/' ';'
printf "Built the Source Engine plugin successfully.\n\n"
@ -139,21 +156,21 @@ fi
if [ "$BUILD_BULLET" -eq 1 ]
then
gmake -j $BUILD_PROC plugins-rel NATIVE_PLUGINS="bullet"
CC=$ENGINE_CC CXX=$ENGINE_CXX gmake -j $BUILD_PROC plugins-rel NATIVE_PLUGINS="bullet"
find ./release/ -name 'fteplug_bullet_*.so' -exec cp -prv '{}' '../../../bin/' ';'
printf "Built the bullet plugin successfully.\n\n"
fi
if [ "$BUILD_ODE" -eq 1 ]
then
gmake -j $BUILD_PROC plugins-rel NATIVE_PLUGINS="ode"
CC=$ENGINE_CC CXX=$ENGINE_CXX gmake -j $BUILD_PROC plugins-rel NATIVE_PLUGINS="ode"
find ./release/ -name 'fteplug_ode_*.so' -exec cp -prv '{}' '../../../bin/' ';'
printf "Built the ode plugin successfully.\n\n"
fi
if [ "$BUILD_FFMPEG" -eq 1 ]
then
gmake -j $BUILD_PROC plugins-rel NATIVE_PLUGINS="ffmpeg"
CC=$ENGINE_CC CXX=$ENGINE_CXX gmake -j $BUILD_PROC plugins-rel NATIVE_PLUGINS="ffmpeg"
find ./release/ -name 'fteplug_ffmpeg_*.so' -exec cp -prv '{}' '../../../bin/' ';'
printf "Built the ffmpeg plugin successfully.\n\n"
fi

View File

@ -26,6 +26,21 @@ else
BUILD_PROC=$(nproc)
fi
# Compiler choice
if [ "$COMPILE_SYS" = "OpenBSD" ]
then
ENGINE_CC=cc
ENGINE_CXX=c++
else
if [ "$BUILD_CLANG" = "1" ]; then
ENGINE_CC=clang
ENGINE_CXX=clang++
else
ENGINE_CC=gcc
ENGINE_CXX=g++
fi
fi
mkdir -p ./bin
if [ -f "$VVM_MAKEFILE" ]
@ -50,7 +65,7 @@ then
gmake clean
fi
gmake -j $BUILD_PROC
CC=$ENGINE_CC CXX=$ENGINE_CXX gmake -j $BUILD_PROC
printf "Built vvmtool successfully.\n"
cp -v vvmtool ../../bin/vvmtool
printf "DONE. Built ALL components successfully.\n"