diff options
| author | Stefan Boberg <[email protected]> | 2026-03-04 14:00:34 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-03-04 14:00:34 +0100 |
| commit | 794f093057c58c4909a0653edb54fdf869560596 (patch) | |
| tree | a730072e40f7eb60c7761ffb44c939aa1ad981bb /README.md | |
| parent | IterateChunks callback is multithreaded - make sure AttachmentsSize can handl... (diff) | |
| download | zen-794f093057c58c4909a0653edb54fdf869560596.tar.xz zen-794f093057c58c4909a0653edb54fdf869560596.zip | |
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.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 68 |
1 files changed, 32 insertions, 36 deletions
@@ -75,60 +75,56 @@ line. ## Building on Linux -The following instructions have been collated using Ubuntu 20.04. - -Zen makes use of C++20 features which at the time of writing has limited -toolchain and C++ library support. A minimum compiler version of GCC-11 or -Clang-12 is required, along with GNU's libstdc+++-11 or newer. - -The first step is to acquire a suitable compiler and C++ library. On Ubuntu 20.04 -GCC-11 is not available in the standard package repositories so Ubuntu's tool- -chain test respository needs to be added to Apt (note that this is _not required_ -for Ubuntu 21.04 onwards); - -``` -sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test -``` - -Now GCC-11 can be installed via Apt. This will also install a suitable version of -the C++ library. - -``` -sudo apt install -y --no-install-recommends g++-11 -g++-11 --version -``` - -The easiest way to tell `xmake` to use the correct compiler version is to set -the `CXX` environment variable. +The following instructions have been collated using Ubuntu 24.04. Other distributions will +likely need a slightly different set of packages installed. -``` -export CXX=g++-11 +```bash +sudo apt install -y build-essential pkg-config unzip ``` Install [xmake](https://xmake.io/#/getting_started). -``` +It's important to use the correct version when installing, pay attention to the last argument in the command line below: + +```bash curl -fsSL https://xmake.io/shget.text | bash -s v2.9.9 ``` -Clone the Zen project and tell `xmake` to use the correct GCC version. +Clone the Zen project. -``` +```bash git clone https://github.com/EpicGames/zen.git ~/zen/main cd ~/zen/main ``` -Now we are ready to build Zen. The `-y` skips `xmake` from prompting about -building packages. +We recommend building using the UE Linux toolchain, to match the Unreal Editor +setup as closely as possible. It is also the most thoroughly tested toolchain +since this is what is used in the CI environment which produces the binaries +which end up in the UE tree. + +Using other toolchains may or may not work depending on which version and +compiler you happen to be using. +### Building with the UE Linux toolchain + +To build with the Unreal Engine cross-compile toolchain (producing binaries +compatible with the VFX Reference Platform), first download the toolchain: + +```bash +scripts/ue_build_linux/get_ue_toolchain.sh ``` -xmake config -y --mode=debug + +This downloads to `~/.ue-toolchain` by default. xmake automatically detects the +toolchain at this location, so no extra flags are needed: + +```bash +xmake config -y -m debug xmake build ``` -Note that the command above to set the build variant to debug is optional. Tests -are only built in debug.The `xmake` flags `-vD` can be useful to diagnose -`xmake` issues. +The toolchain can also be selected explicitly with `--toolchain=ue-clang`, and +the SDK location can be overridden with `--sdk=<path>` or the +`UE_TOOLCHAIN_DIR` environment variable. ## Building on Mac |