You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Alibek Omarov cc4aebd61a wscript: remove dead option 1 year ago
.github/workflows Build linux version in Steam runtime. Add building with msvc into workflow and upload artifacts. (#181) 1 year ago
cl_dll Move M_PI definition to header. 1 year ago
cmake Haiku OS support (#170) 1 year ago
common #ifdef->#if. 1 year ago
dlls #ifdef->#if. 1 year ago
engine #ifdef->#if. 1 year ago
game_shared #ifdef->#if. 1 year ago
pm_shared #ifdef->#if. 1 year ago
public #ifdef->#if. 1 year ago
scripts/waifulib waifulib: xcompile: upgrade again from engine tree, fix motomagx build 1 year ago
utils Add custom makefont from #46 5 years ago
.gitignore Bump minimum CMake version (lower versions are deprecated) (#182) 1 year ago
.travis.yml Fix addressing variables in travis 4 years ago Improve client 7 years ago
CMakeLists.txt Silence useless warning on Windows (#183) 1 year ago
LICENSE replace gnu.txt with LICENSE from ValveSoftware/halflife (#84) 3 years ago Add github workflow and change the link and badge from travis to github actions (#174) 1 year ago
appveyor.yml Fix windows build (#179) 1 year ago
waf waf: upgrade to waifu 1.1.0 1 year ago
waf.bat add waf.bat 3 years ago
wscript wscript: remove dead option 1 year ago

Half-Life SDK for Xash3D Build Status Windows Build Status

Half-Life SDK for Xash3D & GoldSource with some fixes.

How to build

CMake as most universal way

mkdir build && cd build
cmake ../

Crosscompiling using mingw:

mkdir build-mingw && cd build-mingw
TOOLCHAIN_PREFIX=i686-w64-mingw32 # check up the actual mingw prefix of your mingw installation

You may enable or disable some build options by -Dkey=value. All available build options are defined in CMakeLists.txt at root directory. See below if you want to build the GoldSource compatible libraries.

See below, if CMake is not suitable for you:


Using msvc

We use compilers provided with Microsoft Visual Studio 6. There're compile.bat scripts in both cl_dll and dlls directories. Before running any of those files you must define MSVCDir variable which is the path to your msvc installation.

set MSVCDir=C:\Program Files\Microsoft Visual Studio

These scripts also can be ran via wine:

MSVCDir="z:\home\$USER\.wine\drive_c\Program Files\Microsoft Visual Studio" wine cmd /c compile.bat

The libraries built this way are always GoldSource compatible.

There're dsp projects for Visual Studio 6 in cl_dll and dlls directories, but we don't keep them up-to-date. You're free to adapt them for yourself and try to import into the newer Visual Studio versions.

Using mingw



To use waf, you need to install python (2.7 minimum)

(./waf configure -T release)


Just typical ndk-build. TODO: describe what it is.

Building GoldSource-compatible libraries

To enable building the goldsource compatible client library add GOLDSOURCE_SUPPORT flag when calling cmake:


or when using waf:

 ./waf configure -T release --enable-goldsrc-support

Unlike original client by Valve the resulting client library will not depend on vgui or SDL2 just like the one that's used in FWGS Xash3d.

Note for Windows: it's not possible to create GoldSource compatible libraries using mingw, only msvc builds will work.

Note for Linux: GoldSource requires libraries (both client and server) to be compiled with libstdc++ bundled with g++ of major version 4 (versions from 4.6 to 4.9 should work). If your Linux distribution does not provide compatible g++ version you have several options.

Method 1: Statically build with c++ library

This one is the most simple but has a drawback.

cmake ../ -DGOLDSOURCE_SUPPORT=ON -DCMAKE_C_FLAGS="-static-libstdc++ -static-libgcc"

The drawback is that the compiled libraries will be larger in size.

Method 2: Build in Steam Runtime chroot

This is the official way to build Steam compatible games for Linux.

Clone and follow instructions

sudo ./ --i386

Then use cmake and make as usual, but prepend the commands with schroot --chroot steamrt_scout_i386 --:

mkdir build-in-steamrt && cd build-in-steamrt
schroot --chroot steamrt_scout_i386 -- cmake ../ -DGOLDSOURCE_SUPPORT=ON
schroot --chroot steamrt_scout_i386 -- make

Method 3: Create your own chroot with older distro that includes g++ 4.

Use the most suitable way for you to create an old distro 32-bit chroot. E.g. on Debian (and similar) you can use debootstrap.

sudo debootstrap --arch=i386 jessie /var/chroot/jessie-debian-i386 # On Ubuntu type trusty instead of jessie
sudo chroot /var/chroot/jessie-debian-i386

Inside chroot install cmake, make, g++ and libsdl2-dev. Then exit the chroot.

On the host system install schroot. Then create and adapt the following config in /etc/schroot/chroot.d/jessie.conf (you can choose a different name):

description=Debian jessie i386

Insert your actual user name in place of yourusername. Then prepend any make or cmake call with schroot -c jessie --:

mkdir build-in-chroot && cd build-in-chroot
schroot --chroot jessie -- cmake ../ -DGOLDSOURCE_SUPPORT=ON
schroot --chroot jessie -- make

Method 4: Install the needed g++ version yourself

TODO: describe steps.

Configuring Qt Creator to use toolchain from chroot

Create a file with the following contents anywhere:

schroot --chroot steamrt_scout_i386 -- cmake "$@"

Make it executable. In Qt Creator go to Tools -> Options -> Build & Run -> CMake. Add a new cmake tool and specify the path of previously created file. Go to Kits tab, clone your default configuration and choose your CMake tool there. Choose the new kit when opening CMakeLists.txt.