[CMake] Build LLVM from the submodule if there's no suitable version

When RPCS3 is compiled with LLVM (default option), CMake only tries to
find LLVM on the default system installation. So the OS must have a
sytstem-wide installation of LLVM of at least version 4.0, which is not
available on many GNU/Linux distributions (e.g. Ubuntu 16.04, Debian
Stretch). If CMake can not find a suitable version, it silently falls
back to compile RPCS3 without LLVM.

This patch makes CMake defaults to compile the LLVM submodule if and
only if a suitable LLVM version is not found installed on the system.
Due to a build time check on LLVM, in-tree builds will not work when
building the submodule (LLVM does not allow in-source builds). For this
reason, the instruction for building on CMake were updated.
This commit is contained in:
Henrique Jung 2017-10-01 03:26:42 -03:00 committed by kd-11
parent 1572d01c53
commit 76b7103fed
2 changed files with 25 additions and 1 deletions

View file

@ -63,7 +63,8 @@ To initialize the repository don't forget to execute `git submodule update --ini
1) `git clone https://github.com/RPCS3/rpcs3.git` </br>
2) `cd rpcs3/` </br>
3) `git submodule update --init` </br>
4) `cmake CMakeLists.txt && make GitVersion && make` </br>
4) `cd ../ && mkdir rpcs3_build && cd rpcs3_build`
4) `cmake ../rpcs3/ && make GitVersion && make` </br>
5) Run RPCS3 with `./bin/rpcs3` </br>
If you are on MacOS and want to build with brew llvm and qt don't forget to add the following environment variables