diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 76 |
1 files changed, 36 insertions, 40 deletions
@@ -56,7 +56,7 @@ from a Command Prompt window or a Terminal instance * build all targets at once: `xmake` Compiled binaries end up in the `build` directory. xmake uses the `.xmake` directory to store -project specific state. For more tips on working with xmake, see [xmake notes](docs/xmake.md) +project specific state. For more tips on working with xmake, see [xmake notes](docs/dev/xmake.md) ### Installing pre-commit (optional but recommended) @@ -67,7 +67,7 @@ commit. * You can install using `winget install python3` * Run `pip install pre-commit==3.2.0` (later versions may or may not work) * If you want the pre-commit steps to be run at commit time (which is recommended) you can - run `pre-commit install` within your local repo. + run `python -m pre_commit install` within your local repo. Once you have pre-commit installed, it's convenient to use the provided xmake task to trigger it manually to apply clang-format rules. You can do this by running `xmake precommit` on the command @@ -75,61 +75,56 @@ line. ## Building on Linux -The following instructions have been collated using Ubuntu 20.04. +The following instructions have been collated using Ubuntu 24.04. Other distributions will +likely need a slightly different set of packages installed. -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 +```bash +sudo apt install -y build-essential pkg-config unzip ``` -Now GCC-11 can be installed via Apt. This will also install a suitable version of -the C++ library. +Install [xmake](https://xmake.io/#/getting_started). -``` -sudo apt install -y --no-install-recommends g++-11 -g++-11 --version +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 ``` -The easiest way to tell `xmake` to use the correct compiler version is to set -the `CXX` environment variable. +Clone the Zen project. -``` -export CXX=g++-11 +```bash +git clone https://github.com/EpicGames/zen.git ~/zen/main +cd ~/zen/main ``` -Install [xmake](https://xmake.io/#/getting_started). +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. -``` -curl -fsSL https://xmake.io/shget.text | bash -xmake --version -``` +Using other toolchains may or may not work depending on which version and +compiler you happen to be using. -Clone the Zen project and tell `xmake` to use the correct GCC version. +### Building with the UE Linux toolchain -``` -git clone https://github.com/EpicGames/zen.git ~/zen/main -cd ~/zen/main +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 ``` -Now we are ready to build Zen. The `-y` skips `xmake` from prompting about -building packages. +This downloads to `~/.ue-toolchain` by default. xmake automatically detects the +toolchain at this location, so no extra flags are needed: -``` -xmake config -y --mode=debug +```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 @@ -177,7 +172,7 @@ brew install pkgconfig # Contributing Code -See [CODING.md](docs/CODING.md) +See [CODING.md](docs/dev/CODING.md) # Debugging @@ -189,6 +184,7 @@ is incredibly handy. When that is installed you may enable auto-attach to child * There are some test projects * `zencore-test` exercises unit tests in the zencore project * `zenserver-test` exercises the zen server itself (functional tests) + * `zen-test` exercises the `zen` CLI end-to-end (functional tests) The tests are implemented using [doctest](https://github.com/onqtam/doctest), which is similar to Catch in usage. |