This repository has been archived by the owner on Dec 24, 2023. It is now read-only.
forked from LevShisterov/BugfixedHL
-
Notifications
You must be signed in to change notification settings - Fork 5
Building guide
Дмитрий edited this page Jul 21, 2019
·
6 revisions
BugfixedHL uses CMake to generate build files for various platforms and IDEs.
The repository needs to be cloned recursively to fetch all submodules. GitHub's "Download ZIP" will not work correctly.
-
USE_VGUI2
- configures whether or not VGUI2 and its UI elements should be enabled. -
VGUI2_BUILD_4554
- disables some features (like SteamAPI or HTML) to support engine build 4554. -
AUTO_DEPLOY
- whether or not built files should be copied to deployment paths. See below for details. -
USE_UPDATER
- whether or not updater will be enabled. Requires cURL library (libcurl4-openssl-dev on Ubuntu). - GCC/Clang-only:
-
GCC_NO_OPTIMIZE
- disable all optimizations (-O0) -
GCC_CHECK_FOR_UB
- enable run-time checks for undefined behavior (-fsanitize=address,undefined -fstack-protector)
-
- Windows 7 or newer
- Visual Studio 2017 or newer
- Git for Windows
- CMake
- Clone the repository using Git
git clone --recursive https://github.com/tmp64/BugfixedHL.git
- Use CMake to generate build files for Visual Studio.
If you wish to use other IDE (e.g. Qt Creator or Visual Studio Code), you will have to build with MSVC++ compiler. GCC/MinGW/MSYS and others are not supported on Windows.- Use CMake GUI
- Set the source code location to <repo root>.
- Set the build directory to <repo root>/build
build* directories are ignored by Git. - Press "Configure" and set your Visual Studio version.
- Change settings however you like.
- Press "Configure" and "Generate".
- Use CMake CLI
cd BugfixedHL mkdir build cd build cmake -DUSE_VGUI2=1 -DAUTO_DEPLOY=1 ..
- Use CMake GUI
- Open /build/BugfixedHL.sln in Visual Studio and you're done.
- Git
- CMake
- C++14 compiler. Tested with GCC 7, Clang should work too.
make
-
patchelf
(see scripts/FixClientLibPath.sh for details) -
libcurl-openssl-dev
if building with updater (you probably don't need it)
- Clone the repository using Git
git clone --recursive https://github.com/tmp64/BugfixedHL.git
- If your IDE supports CMake, use it. Otherwise, generate Makefiles using CMake.
cd BugfixedHL mkdir build cd build cmake -DUSE_VGUI2=1 -DAUTO_DEPLOY=1 -DCMAKE_TOOLCHAIN_FILE="../cmake/Linux32Toolchain.cmake" ..
- Now you can use
make
in build directory to build the libraries.
macOS is not supported at the moment. You're on your own.
BugfixedHL provides a way to automatically copy built libraries to necessary locations during development.
This is done by enabling AUTO_DEPLOY
in CMake, creating PublishPath<something>.txt in <repo root>/scripts and filling it with paths where files should be copied to, one path per line.
- File name: PublishPathClient.txt
- Contents: path to cl_dlls folder
- Example:
D:\Projects\HalfLife\HL1_Debugging\Client1\valve\cl_dlls
- Files to be copied:
- client.dll/client.so
- client.pdb (Windows only)
- File name: PublishPathServer.txt
- Contents: path to dlls folder
- Example:
D:\Projects\HalfLife\HL1_Debugging\Server1\valve\dlls
- Files to be copied:
- hl.dll/hl.so
- hl.pdb (Windows only)
- File name: PublishPathAMXXModules.txt
- Contents: path to AMX Mod X modules folder
- Example:
D:\Projects\HalfLife\HL1_Debugging\Server1\valve\addons\amxmodx\modules
- Files to be copied:
- bugfixedapi_amxx.dll/bugfixedapi_amxx_i386.so
- bugfixedapi_amxx.pdb (Windows only)
BugfixedHL has a cross-platform build script that can generate .zip archive with all necessary files.
See help for details:
./scripts/BuildRelease.ps1 -Target Help
Requirements:
- Git
- Visual Studio 2017 or 2019
- CMake
Requirements:
- Git
- CMake
-
ninja
(ninja-build package) patchelf
- PowerShell Core