SkiaSharp Build Instructions
Tommi Gustafsson edited this page Sep 5, 2023
·
33 revisions
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
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.
- 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
.
- 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.
- Open PowerShell.
- Run
dotnet tool install -g cake.tool
- Open PowerShell.
- Type
python3
. - Install python3 from Microsoft Store. (Do not download it from the Internet.)
- 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.
- 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:
-
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:
- 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.
- Open PowerShell.
- Go to the
source
folder in the SkiaSharp repository. - Run
dotnet build
. - This will build SkiaSharp C# DLLs to various
bin
folders.
© Sound Mind Games 2020–2022