From e4a04968dcc9b785deb95aefaee53969868019e0 Mon Sep 17 00:00:00 2001 From: lynxnb Date: Tue, 29 Mar 2022 16:49:31 +0200 Subject: [PATCH] Create a BUILDING.md file with building instructions --- BUILDING.md | 118 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 BUILDING.md diff --git a/BUILDING.md b/BUILDING.md new file mode 100644 index 00000000..adfe6c25 --- /dev/null +++ b/BUILDING.md @@ -0,0 +1,118 @@ +# Building Guide + +### Software needed +* [Git](https://git-scm.com/download) +* [Android Studio](https://developer.android.com/studio) – We recommend to get the latest stable version + +### Steps +
Windows only +

+ +> In a terminal prompt with **administrator** privileges, enable git symlinks globally: +> +> ```cmd +> git config --global core.symlinks true +> ``` +> +> Use this elevated prompt for the next steps. + +

+
+ +Clone the repo **recursively**, either with your preferred Git GUI or with the command below: +```cmd +git clone https://github.com/skyline-emu/skyline.git --recursive +``` + +Open Android Studio +
First time users only +

+ +> If you opened Android Studio for the first time, choose the `Standard` install type and complete the setup wizard leaving all settings to their default value. +>

+> If you get any errors on "Intel® HAXM" or "Android Emulator Hypervisor Driver for AMD Processors", you can safely ignore them as they won't be used for Skyline. + +

+
+ +Import the project by clicking on the `Open` icon, then in the file picker choose the `skyline` folder you just cloned in the steps above: +

+ + +

+ +Exclude the following folders from indexing: +- `app/libraries/llvm` +- `app/libraries/boost` + +To exclude a folder, switch to the project view: +

+ + +

+ +In the project view navigate to the `app/libraries` folder, right-click on the folder you want to exclude and navigate the menus to the `Exclude` option: +

+ + +

+ +If an `Invalid Gradle JDK configuration found` error comes up, select `Use Embedded JDK`: +

+ +An error about NDK not being configured will be shown: +

+ +Ignore the suggested version reported by Android Studio. Instead, find the NDK version to download inside the `app/build.gradle` file: +```gradle +ndkVersion 'X.Y.Z' +``` +From that same file also note down the CMake version required: +```gradle +externalNativeBuild { + cmake { + version 'A.B.C+' + path "CMakeLists.txt" + } +} +``` + +Open the SDK manager from the top-right toolbar: +

+ +Navigate to the `SDK Tools` tab and enable the `Show Package Details` checkbox in the bottom-right corner: +

+ +Expand the `NDK (Side by side)` and `CMake` entries, select the appropriate version from the previous step, then click `OK`. + +Finally, sync the project: +

+ + +## Common issues (and how to fix them) + +* `Cmake Error: CMake was unable to find a build program corresponding to "Ninja"` + +Check that you installed the correct CMake version in the Android Studio SDK Manager. If you're sure you have the correct one, you may try adding the path to CMake binaries installed by Android Studio to the `local.properties` file: +```properties +cmake.dir= +``` +E.g. on Windows: +```properties +cmake.dir=C\:\\Users\\skyline\\AppData\\Local\\Android\\Sdk\\cmake\\3.18.1 +``` + +* `'shader_compiler/*.h' file not found` + +You didn't clone the repository with symlinks enabled. Windows requires administrator privileges to create symlinks so it's likely it didn't create them. +In an **administrator** terminal prompt navigate to the Skyline root project folder and run: +```cmd +git submodule deinit app/libraries/shader-compiler +git config core.symlinks true +git submodule foreach git config core.symlinks true +git submodule update --init --recursive app/libraries/shader-compiler +``` +If you'd like to, you can enable symlinks globally by running: (this will only affect new repositories) +```cmd +git config --global core.symlinks true +```