Building the Half-Life Unified SDK from source produces the client and server game libraries (DLLs on Windows, shared objects on Linux) that power your mod. The SDK uses CMake to generate project files for Visual Studio on Windows or Unix Makefiles on Linux, and relies on vcpkg to automatically download and compile most third-party dependencies. Once built, theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/twhl-community/halflife-unified-sdk/llms.txt
Use this file to discover all available pages before exploring further.
INSTALL target copies the compiled libraries directly into your mod directory so you can launch and test immediately.
These instructions assume a strong grasp of C++, CMake, Git, vcpkg, and your platform’s compiler toolchain (Visual Studio on Windows or GCC/Make on Linux). All Linux instructions are written for Ubuntu — substitute commands as needed for your distribution.
Minimum Requirements
All platforms require CMake 3.23 or newer. Download it from cmake.org/download.- Windows
- Linux
- Operating system: Windows 7 or newer
- Compiler: Visual Studio 2019 or newer
- Desktop development with C++
- MSVC v142 — VS 2019 C++ x64/x86 build tools (Latest), or the equivalent for your Visual Studio version
- C++ profiling tools
- Windows 10 SDK (select the latest available version)
vcpkg uses the latest version of Visual Studio installed on your system to compile dependencies. If you have multiple versions installed, always use the newest one to build the SDK itself — mixing versions can cause compiler errors.
Clone the Repository
The SDK uses Git submodules, so you must clone with--recurse-submodules to get all required source code:
Change the Mod Name
Before generating project files, set the display name for your mod. This name appears in the game window title, Task Manager, and Steam. Openconfig/liblist.gam.in in a text editor and change:
Generate Project Files with CMake
- Windows
- Linux
Open CMake GUI and set the two path fields:
You can also configure optional debugging helpers:
Once all variables are set, click Generate to produce the Visual Studio solution.
- Where is the source code — the directory you cloned the repository into
- Where to build the binaries — a new directory next to the source folder, e.g.
halflife-unified-sdk_build
- Generator: Visual Studio 16 2019 (or your installed version)
- Platform: Win32
- Toolchain: select Specify toolchain file for cross-compiling, then click Next
cmake folder, and select WindowsToolchain.cmake. Click Finish.CMake will perform its first-run setup. vcpkg will download, build, and install all dependencies — this can take several minutes the first time.After configuration completes, you will see new variables highlighted in red. Set these key variables:| Variable | Description |
|---|---|
CMAKE_INSTALL_PREFIX | Path to your mod directory, e.g. C:/Program Files (x86)/Steam/steamapps/common/Half-Life/hlu |
HalfLife_HLDS_DIRECTORY | (Optional) Path to the directory containing hlds.exe if you want dedicated server debugging |
HalfLife_RELEASE_TYPE | Set to Pre-Alpha or Alpha to enable the on-screen project info overlay |
| Variable | Description |
|---|---|
HalfLife_ENABLE_CONSOLE | Enable the developer console on startup |
HalfLife_ENABLE_CHEATS | Enable cheats on startup |
HalfLife_DEVELOPER_LEVEL | Set the developer output verbosity level |
HalfLife_ADDITIONAL_COMMAND_ARGUMENTS | Extra launch arguments, e.g. +map c2a5 |
Build and Install
- Windows
- Linux
Open
Build the INSTALL project to compile the mod and deploy the libraries to your mod directory. Then press F5 to launch the game (Steam must be running).
HalfLifeMod.sln from the build directory in Visual Studio. The solution contains the following projects:| Project | Purpose |
|---|---|
client | Half-Life mod client library |
server | Half-Life mod server library |
INSTALL | Builds all targets and copies libraries + debug info to CMAKE_INSTALL_PREFIX |
ALL_BUILD | CMake utility — builds all projects |
ZERO_CHECK | Re-runs CMake when built |
ProjectInfo | Regenerates the HUD project info; built automatically with client/server |