aboutsummaryrefslogtreecommitdiff
path: root/scripts/ue_build_linux/ue_build.sh
blob: 690f9f661efa96aeaf3e373e649a3cb46a064895 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
ZEN_ROOT=$(realpath $SCRIPT_DIR/../..)

die() { echo ERROR: $1; exit 1; }

if [[ $1 == "--help" ]]; then
	echo "usage: $0 <ue_toolchain_dir> (defaults to ${ZEN_ROOT}/.tmp-ue-toolchain)"
	exit
fi

toolchain_dir="${1:-${ZEN_ROOT}/.tmp-ue-toolchain}"

# Validate input

if ! [ -d $toolchain_dir ]; then
	die "$1 is not a directory"
fi

if ! [ -e $toolchain_dir/bin/clang++ ]; then
	die "$1/bin/clang++ does not exist"
fi

export UE_TOOLCHAIN_DIR=$(realpath $toolchain_dir)
export CC="clang"
export CXX="clang++"
export LD="clang++"

export PATH="$(realpath $(dirname ${BASH_SOURCE[0]})):$PATH"

shift
exec "$@"