Portable Half-Life SDK. GoldSource and Xash3D. Crossplatform.
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.
 
 
 
 
 
 
Roman Chistokhodov e6ea89705f Update README.md, update makefiles, add .bat scripts for msvc 7 years ago
cl_dll Update README.md, update makefiles, add .bat scripts for msvc 7 years ago
common Add protection for vec3_t definition. 7 years ago
dlls Update README.md, update makefiles, add .bat scripts for msvc 7 years ago
engine Change __MSC_VER to _MSC_VER to make the client buildable with VS 6 7 years ago
game_shared Revert some changes from PR 8 years ago
pm_shared Remove unneeded macros. 7 years ago
utils Some cleanup. Add false_vgui include path to makefiles 7 years ago
.gitignore Add build/ to gitignore 8 years ago
.travis.yml conditional apt-get 8 years ago
Android.mk Improve client 9 years ago
CMakeLists.txt goldsource mouse input 7 years ago
README.md Update README.md, update makefiles, add .bat scripts for msvc 7 years ago
backup.bat Upload first port 9 years ago
backup.lst Upload first port 9 years ago
debug.bat Upload first port 9 years ago
gnu.txt CRLF to LF for license. 8 years ago
make_sdk.bat Upload first port 9 years ago
release.bat Upload first port 9 years ago
xash.dsw Upload first port 9 years ago
xash_sdk.dsw Upload first port 9 years ago
xash_sdk.lst Upload first port 9 years ago

README.md

Half-Life SDK for Xash3D Build Status

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

How to build

CMake as most universal way

mkdir build && cd build
cmake ../
make

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:

Windows

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
compile.bat

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 MVS 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 MVS versions.

Using mingw

TODO

Linux

(cd dlls && make)
(cd cl_dll && make)

OS X

TODO

FreeBSD

(cd dlls && gmake CXX=clang++ CC=clang)
(cd cl_dll && gmake CXX=clang++ CC=clang)

Android

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:

cmake .. -DGOLDSOURCE_SUPPORT=ON

or when using make without cmake:

make GOLDSOURCE_SUPPORT=1

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 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: Create and use 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):

[jessie]
type=directory
description=Debian jessie i386
directory=/var/chroot/debian-jessie-i386/
users=yourusername
groups=yourusername
root-groups=root
preserve-environment=true
personality=linux32

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

schroot -c jessie -- cmake ../ -DGOLDSOURCE_SUPPORT=ON
schroot -c jessie -- make

Method 3: Install the needed g++ version yourself

TODO: describe steps.