mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-04-16 22:42:31 +03:00
39 lines
1021 B
Bash
Executable File
39 lines
1021 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
script=$(readlink -f -- "$0")
|
|
pushd "$(dirname -- "$script")" > /dev/null
|
|
|
|
source sdk_container
|
|
run_in_sniper "$@"
|
|
|
|
if [ $# -eq 0 ]; then
|
|
export VPC_NINJA_BUILD_MODE="release"
|
|
else
|
|
if [[ "$1" == "debug" ]]; then
|
|
export VPC_NINJA_BUILD_MODE="debug"
|
|
elif [[ "$1" == "release" ]]; then
|
|
export VPC_NINJA_BUILD_MODE="release"
|
|
else
|
|
echo "Usage: $0 [debug|release]"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
solution_out="_vpc_/ninja/sdk_everything_$VPC_NINJA_BUILD_MODE"
|
|
|
|
if [[ ! -e "$solution_out.ninja" ]]; then
|
|
devtools/bin/vpc /hl2 /episodic /linux64 /ninja /define:SOURCESDK +shaders /mksln "$solution_out"
|
|
|
|
# Generate compile commands.
|
|
ninja -f "$solution_out.ninja" -t compdb > compile_commands.json
|
|
# Remove some unsupported clang commands.
|
|
sed -i 's/-fpredictive-commoning//g; s/-fvar-tracking-assignments//g' compile_commands.json
|
|
sed -i 's|/my_mod/src|.|g' compile_commands.json
|
|
fi
|
|
|
|
ninja -f "$solution_out.ninja" -j$(nproc)
|
|
|
|
popd
|