From 794f093057c58c4909a0653edb54fdf869560596 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Wed, 4 Mar 2026 14:00:34 +0100 Subject: native xmake toolchain definition for UE-clang (#805) This change is meant to provide a smoother experience when working on Linux. After this change, the toolchain setup process is now simply ```bash $ scripts/ue_build_linux/get_ue_toolchain.sh ``` and then at config time the toolchain is automatically detected if you downloaded it to the default location or have the `UE_TOOLCHAIN_DIR` environment variable set ```bash xmake config --mode=debug ``` Compared to the old script-based approach this configures the toolchain more precisely, avoiding leakage into unrelated build processes such as when a package manager decides to build something like Ninja locally etc. --- scripts/ue_build_linux/README.md | 42 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'scripts/ue_build_linux/README.md') 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 +## 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 [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=` (must be absolute) or +the `UE_TOOLCHAIN_DIR` environment variable. -- cgit v1.2.3