diff options
| author | Liam Mitchell <[email protected]> | 2026-03-09 19:06:36 -0700 |
|---|---|---|
| committer | Liam Mitchell <[email protected]> | 2026-03-09 19:06:36 -0700 |
| commit | d1abc50ee9d4fb72efc646e17decafea741caa34 (patch) | |
| tree | e4288e00f2f7ca0391b83d986efcb69d3ba66a83 /scripts/ue_build_linux | |
| parent | Allow requests with invalid content-types unless specified in command line or... (diff) | |
| parent | updated chunk–block analyser (#818) (diff) | |
| download | zen-d1abc50ee9d4fb72efc646e17decafea741caa34.tar.xz zen-d1abc50ee9d4fb72efc646e17decafea741caa34.zip | |
Merge branch 'main' into lm/restrict-content-type
Diffstat (limited to 'scripts/ue_build_linux')
| -rwxr-xr-x | scripts/ue_build_linux/README.md | 42 | ||||
| -rwxr-xr-x | scripts/ue_build_linux/clang | 2 | ||||
| -rwxr-xr-x | scripts/ue_build_linux/clang++ | 2 | ||||
| -rwxr-xr-x | scripts/ue_build_linux/get_ue_toolchain.sh | 2 | ||||
| -rwxr-xr-x | scripts/ue_build_linux/ue_build.sh | 33 |
5 files changed, 22 insertions, 59 deletions
diff --git a/scripts/ue_build_linux/README.md b/scripts/ue_build_linux/README.md index e93a234ae..afafcbe24 100755 --- a/scripts/ue_build_linux/README.md +++ b/scripts/ue_build_linux/README.md @@ -2,38 +2,38 @@ This folder contains scripts to build Zen using the UE Linux toolchain. This
can be used to output binaries that meet the VFX Reference Platform versions.
-It works by using the `--sysroot=` option to redirect compilers and linkers to
-find headers and libraries. There are a few components involved;
-1) get_ue_toolchain.sh <toolchain_dir>
+## Setup
+
+Download the toolchain using `get_ue_toolchain.sh`:
```
-$ scripts/ue_build_linux/get_ue_toolchain.sh ./.tmp-ue-toolchain
+$ scripts/ue_build_linux/get_ue_toolchain.sh
```
-This will download the required components from cdn.unrealengine.com and
-structure them in such a way that they can be used by both vcpkg and xmake
-when building Zen.
+By default this downloads to `~/.ue-toolchain`. A custom path can be given as
+the first argument, or via the `UE_TOOLCHAIN_DIR` environment variable.
-2) ue_build.sh <toolchain_dir> <prog> [args...]
+This will download the required components from cdn.unrealengine.com and
+structure them in such a way that they can be used by xmake when building Zen.
-Given the toolchain location downloaded in step (1) and the `VCPKG_ROOT`
-environment variable is properly configured, this script sets up a suitable
-environment and execs the "prog [args...]".
+## Building
-It is expected that this is used to invoke xmake to build Zen;
+xmake automatically detects the toolchain at `~/.ue-toolchain`, so no extra
+flags are needed:
```
-$ scripts/ue_build_linux/ue_build.sh .tmp-ue-toolchain xmake config --mode=debug
-$ scripts/ue_build_linux/ue_build.sh .tmp-ue-toolchain xmake build
+$ xmake config -y -m debug
+$ xmake build -y
```
-It is possible that `--toolchain=clang` may be required as a configuration
-option. The `ue_build.sh` script can also be sourced into the current shell,
-although it is worth noting that this has never been tried.
+To build a release bundle:
-3) `scripts/ue_build_linux/clang` / `scripts/ue_build_linux/clang++`
+```
+$ xmake config -y -m release
+$ xmake bundle -y
+```
-These acts as shims to the binaries in `toolchain_dir`, adding in the required
-command line arguments to use the correct headers and libraries.
-The `ue_build.sh` script adjusts `$PATH` appropriately.
+The toolchain can also be selected explicitly with `--toolchain=ue-clang`, and
+the SDK location can be overridden with `--sdk=<path>` (must be absolute) or
+the `UE_TOOLCHAIN_DIR` environment variable.
diff --git a/scripts/ue_build_linux/clang b/scripts/ue_build_linux/clang deleted file mode 100755 index 9666ba4ba..000000000 --- a/scripts/ue_build_linux/clang +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec $UE_TOOLCHAIN_DIR/bin/clang --sysroot=$UE_TOOLCHAIN_DIR $CFLAGS "$@" diff --git a/scripts/ue_build_linux/clang++ b/scripts/ue_build_linux/clang++ deleted file mode 100755 index be106ae87..000000000 --- a/scripts/ue_build_linux/clang++ +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec $UE_TOOLCHAIN_DIR/bin/clang++ --sysroot=$UE_TOOLCHAIN_DIR -stdlib=libc++ $CXXFLAGS "$@" diff --git a/scripts/ue_build_linux/get_ue_toolchain.sh b/scripts/ue_build_linux/get_ue_toolchain.sh index c2538b09a..0afd40fe3 100755 --- a/scripts/ue_build_linux/get_ue_toolchain.sh +++ b/scripts/ue_build_linux/get_ue_toolchain.sh @@ -5,7 +5,7 @@ ZEN_ROOT=$(realpath $SCRIPT_DIR/../..) die() { echo "ERROR: $1"; exit; } -toolchain_dir="${1:-${ZEN_ROOT}/.tmp-ue-toolchain}" +toolchain_dir="${1:-${UE_TOOLCHAIN_DIR:-${HOME}/.ue-toolchain}}" if [[ $toolchain_dir == "--help" ]]; then echo "usage: $(basename ${BASH_SOURCE[0]}) <output_dir>" diff --git a/scripts/ue_build_linux/ue_build.sh b/scripts/ue_build_linux/ue_build.sh deleted file mode 100755 index 690f9f661..000000000 --- a/scripts/ue_build_linux/ue_build.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/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 "$@" |