SkiaSharp Build Instructions - hyvanmielenpelit/GnollHack GitHub Wiki
1. Prerequisites
1.1 Visual Studio
You should have Visual Studio 2022 installed for GnollHack mobile version development.
In addition to the workloads installed in the above instructions, you need to install the following workload:
- ASP.NET and web development
1.2 PowerShell
Note that in the instructions below, when it says to open "PowerShell", you can either use Visual Studio's Developer PowerShell (View → Terminal) or you can start Windows PowerShell using the Windows Start button.
2. Clone Repository
Using Visual Studio 2022
- Open Visual Studio 2022.
- Use Clone Repository to clone
https://github.com/mono/SkiaSharp.git
. You can clone the repository toC:\repos\mono\SkiaSharp
. - Open Developer PowerShell (View → Terminal).
- You should be automatically in
C:\repos\mono\SkiaSharp
(repository root directory). - Run
git submodule update --init --recursive
.
Using GitHub Desktop
- Download and install GitHub Desktop app from https://desktop.github.com/.
- Start the app.
- Use Clone a repository from the Internet... to clone
https://github.com/mono/SkiaSharp.git
toC:\repos\mono\SkiaSharp
.
This will also download git submodules.
3. Install Tools
3.1 Install dotnet cake
- Open PowerShell.
- Run
dotnet tool install -g cake.tool
3.2 Install Python 3
- Open PowerShell.
- Type
python3
. - Install python3 from Microsoft Store. (Do not download it from the Internet.)
3.3. Install Tizen
- Open Visual Studio.
- Open Extensions → Manage Extensions.
- Install Visual Studio Tools for Tizen.
- Go to Tools → Tizen → Tizen Package Manager.
- Install Tizen Package Manager.
- Open Tizen Package Manager.
- Install the 7.0 Mobile package.
3.4 Install 7-zip and LLVM
- Open PowerShell with Administrator rights. (You can do this at least when you start PowerShell using the Windows Start button.)
- Go to the SkiaSharp repository root directory.
- Run
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
to grant rights to run the script. Answer Y if asked. - Run
.\scripts\install-7zip.ps1
. - Add New Path to PATH environment variable:
C:\Program Files\7-Zip
- Run
.\scripts\install-llvm.ps1
. - Add New Environment Variable:
- Variable Name:
LLVM_HOME
- Variable Value:
C:\Program Files\LLVM
- Variable Name:
3.5 Set ANDROID_NDK_HOME Environment Variable
- Add New Environment Variable:
- Variable Name:
ANDROID_NDK_HOME
- Variable Value:
C:\Microsoft\AndroidNDK\android-ndk-r23c
(If you have a different version or a different location for Android NDK, please use that instead.)
- Variable Name:
4. Build Native Assets
4.1 Android
- Open PowerShell.
- Go to the
native\android
folder in the SkiaSharp repository. - Run
dotnet cake
. - This will build the native android assets — libSkiaSharp.so and libHarfBuzz.so — to the
output\native\android\{abi}\
folders.
5. Build Managed Code (C#)
- Open PowerShell.
- Go to the
source
folder in the SkiaSharp repository. - Run
dotnet build
. - This will build SkiaSharp C# DLLs to various
bin
folders.