Compiling Aseprite in Windows 10
This is a guide to compile Aseprite
It is an open source software dedicated for pixel art. You can also buy it from their website aseprite.org to support this software. Since it is an open source software we can also download the code and compile it for ourselves. Before doing that, you need to read their license agreement and abide by it.
They have a perfectly fine guide about compiling their software right here, but I failed in my first try, I retried it 2-3 times. So if someone is stuck out there this post can help you and I can use it as a reference on a later date.
NOTE: This is for windows 10 only.
This tutorial is covered in two parts
Dependencies and setup
- First you need to install Visual Studio Community 2019 with Desktop development with C++ installed. If you’ve already installed Visual Studio, open Visual Studio Installer and click the modify button to install the packages.
- Install Git, so that we are able to download code from github. After installing git you should be able to run the
git
commands in cmd prompt without any errors.
git --version
- Compiled version of the
aseprite-m81
branch of the Skia library. You can compile it by yourself and use it, just follow the instructions given here. but for the sake of simplicity we will download the pre-built files from here. Download theWindows x64 Release
zip file extract the files underC:\deps\skia
folder.
# Under C:\deps\skia it should look similar to this
.
├── include
├── modules
├── out
├── src
└── third_party
- Latest version of CMake (3.14 or greater). Download the
windows x64 installer
and run it, while installing check theAdd CMake to the system PATH for all users
option.
After installation you should be able to run cmake
commands in the cmd prompt without any errors
cmake --version
- Install Ninja build system you can download it from their github releases page. Download
Ninja Windows
zip file. Inside zip file there is a single executable binary calledninja.exe
you can place it in any folder, just remember where you have placed it, I placed it underC:\Program Files\ninja
folder.
Because it is not automatically installed in the system, you need to add it in Path environment variable
to call ninja from the cmd prompt.
- Search Environment variable in windows search.
- Click Environment Variables button like in first screenshot.
- Select Path under System variables then click Edit button like in second screenshot.
- Click New then paste the path of the folder where
ninja.exe
is placed, in my case it isC:\Program Files\ninja
.
After following these steps you should be able to run ninja
commands in the cmd prompt without any errors. NOTE: Remember you need to restart cmd prompt so that the edited environment variable can take effect.
ninja --version
After completing these steps we should be ready to compile the Aseprite Code.
Software compilation
- Open the
x64 Native Tools Command Prompt for VS 2019
it should be under Visual Studio 2019 folder in Start Menu, or else you can search for it in windows search.
- Change directory to
C:\
and clone Aseprite github files via git. You can also download theAseprite source
zip file from the releases page which gives us a particular aseprite release build, but we are going to get the latest code from github. This gives us all the latest features and bug fixes for the software, but we can also encounter new bugs you never know.
cd c:/
git clone --recursive https://github.com/aseprite/aseprite.git
If there is no errors or it doesn’t say that it failed you should be fine to proceed ahead.
- After Aseprite’s code is downloaded it should be inside
aseprite
folder, createbuild
folder inside it then change directory into it, it places all the build files in one place. If you want, you can delete that folder to rebuild the code or start with a fresh copy of code on later date.
cd aseprite
mkdir build
cd build
- Right now you should be inside
build
folder in your command prompt. Now runCMake
command, it references the skia library, the command takes the library are underC:\deps\skia
folder. if you put these in any other folder you need to edit the command accordingly.
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLAF_BACKEND=skia -DSKIA_DIR=C:\deps\skia -DSKIA_LIBRARY_DIR=C:\deps\skia\out\Release-x64 -DSKIA_LIBRARY=C:\deps\skia\out\Release-x64\skia.lib -G Ninja ..
If there is no errors like in the screenshot, you can proceed ahead.
if not then you can try to re-run the command, If it still doesn’t work you can re-check the following things.
- Skia pre-built file that you downloaded is correct
x64 windows
version. - Skia library is inside correct folder
C:\deps\skia
. - You opened the correct
x64 Native Tools Command Prompt for VS 2019
Check if above things are in order, then try to CMake
command again.
- After successfully executing
CMake
, you can now compile the software by runningNinja
. Run the command inside the build folder.
ninja aseprite
If Ninja
ran without any errors you’ve successfully compiled Aseprite. You can find the executable inside C:\aseprite\build\bin\
called aseprite.exe
. Run the executable to open Aseprite software.
With this you should have a working copy of Aseprite software.
Software update
On a later date if you want to update aseprite with latest code. Pull down the new code from github using git
and repeat the software compilation process. Inside the aseprite the directory run these commands, earlier if you have downloaded the zip file from releases page you need to run the git clone
command first.
git pull
git submodule update --init --recursive