diff options
| author | Martin Ridgers <[email protected]> | 2021-10-01 11:28:09 +0200 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-10-01 11:28:09 +0200 |
| commit | 82d444e5241778903e20f0b0ace8b718aff69a5a (patch) | |
| tree | f74a48200775e929561b39f562b7924d6a349a0a | |
| parent | Fixed link error when building with xmake (diff) | |
| download | zen-82d444e5241778903e20f0b0ace8b718aff69a5a.tar.xz zen-82d444e5241778903e20f0b0ace8b718aff69a5a.zip | |
Added some instructions for building on Linux
| -rw-r--r-- | README.md | 56 |
1 files changed, 55 insertions, 1 deletions
@@ -59,7 +59,61 @@ It's also possible to generate project files for Visual Studio via ## Building on Linux -... coming soon +The following instructions have been collated using Ubuntu 20.04. + +At the time of writing only GCC v11 supports the C++20 features used by Zen. As +this version is not available in the default package repositories we need to +get GCC from one of Ubuntu's toolchain repositories; + +``` +sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test +sudo apt install -y gcc-11 +gcc-11 --version +``` + +Next we need the `xmake` build system. For this we will download and install +`xmake` as a `.deb` package. Check the project's release page for more up to +date `.deb` files; + +``` +wget https://github.com/xmake-io/xmake/releases/download/v2.5.7/xmake-v2.5.7.amd64.deb +sudo dpkg -i xmake-v2.5.7.amd64.deb +xmake --version +``` + +For some of Zen's third party dependencies are provided by Microsoft's `vcpkg` +C++ library manager. After cloning the project there is a initialisation step; + +``` +git clone https://github.com/microsoft/vcpkg.git ~/zen/vcpkg +~/zen/vcpkg/bootstrap-vcpkg.sh +``` + +`xmake` uses an environment variable to find `vcpkg`. Alternatively this can be +done by including `VCPKG_ROOT=...` on the command line when invoking `xmake`; + +``` +export VCPKG_ROOT=~/zen/vcpkg +``` + +Clone the Zen project and tell `xmake` to use the correct GCC version; + +``` +git clone https://github.com/EpicGames/zen.git ~/zen/main +cd ~/zen/main +xmake config --plat=linux --cxx=g++-11 --cc=gcc-11 +``` + +Now we are ready to build Zen. The `--mode=debug` is optional. It has been +included below to show how to change build variants. The `-y` skips `xmake` from +prompting about updating `vcpkg` packages; + +``` +xmake config --mode=debug +xmake build -y +``` + +The `xmake` flags `-vD` can be useful to diagnose `xmake` issues. ## Building on Mac |