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/bundle.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'scripts/bundle.lua') diff --git a/scripts/bundle.lua b/scripts/bundle.lua index 07e120d04..b2a5e1e08 100644 --- a/scripts/bundle.lua +++ b/scripts/bundle.lua @@ -17,7 +17,15 @@ end -------------------------------------------------------------------------------- local function _build(arch, debug, config_args) + import("core.project.config") + config.load() + variant = debug and "debug" or "release" + + -- Preserve toolchain/sdk from current config so --clean doesn't lose them + local toolchain_arg = config.get("toolchain") and ("--toolchain=" .. config.get("toolchain")) or nil + local sdk_arg = config.get("sdk") and ("--sdk=" .. config.get("sdk")) or nil + local ret = _exec( "xmake", "config", @@ -26,6 +34,8 @@ local function _build(arch, debug, config_args) "--mode="..variant, "--arch="..arch, "--zensentry=yes", + toolchain_arg, + sdk_arg, config_args) if ret > 0 then raise("Failed to configure xmake") -- cgit v1.2.3