diff --git a/README.md b/README.md index e95be45ff8..c505a9cba8 100644 --- a/README.md +++ b/README.md @@ -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`
2) `cd rpcs3/`
3) `git submodule update --init`
-4) `cmake CMakeLists.txt && make GitVersion && make`
+4) `cd ../ && mkdir rpcs3_build && cd rpcs3_build` +4) `cmake ../rpcs3/ && make GitVersion && make`
5) Run RPCS3 with `./bin/rpcs3`
If you are on MacOS and want to build with brew llvm and qt don't forget to add the following environment variables diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index d093c4c9dd..641be7d324 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -166,6 +166,29 @@ find_package(OpenGL REQUIRED) find_package(OpenAL REQUIRED) if (NOT WITHOUT_LLVM) find_package(LLVM 4.0 CONFIG) + if (NOT LLVM_FOUND) + message("System LLVM was not found, LLVM will be built from the submodule.") + + set(LLVM_TARGETS_TO_BUILD "X86" CACHE INTERNAL "") + option(LLVM_BUILD_RUNTIME OFF) + option(LLVM_BUILD_TOOLS OFF) + option(LLVM_INCLUDE_DOCS OFF) + option(LLVM_INCLUDE_EXAMPLES OFF) + option(LLVM_INCLUDE_TESTS OFF) + option(LLVM_INCLUDE_TOOLS OFF) + option(LLVM_INCLUDE_UTILS OFF) + option(WITH_POLLY OFF) + + # LLVM needs to be built out-of-tree + add_subdirectory(../llvm ../llvm_build) + set(LLVM_DIR "${CMAKE_CURRENT_BINARY_DIR}/../llvm_build/lib/cmake/llvm/") + + # now tries to find LLVM again + find_package(LLVM 4.0 CONFIG) + if (NOT LLVM_FOUND) + message(WARNING "Couldn't build LLVM from the submodule. You might need to run `git submodule update --init`") + endif() + endif() endif()