Skip to content

Instantly share code, notes, and snippets.

@VermeilChan
Last active July 22, 2024 19:27
Show Gist options
  • Save VermeilChan/3fd0188afeb8d49f219efb008b612197 to your computer and use it in GitHub Desktop.
Save VermeilChan/3fd0188afeb8d49f219efb008b612197 to your computer and use it in GitHub Desktop.
Compile Aseprite from source code for Windows 11/10 x64

Prerequisites

Download and Set Up Visual Studio Community 2022

Get The Source Code

Download and Set Up CMake

  • Get CMake cmake-3.xx.x-windows-x86_64.msi

  • Choose the option Add CMake To The PATH For environment variable

Download and Set Up Ninja

  • Download Ninja Build System.

  • Extract ninja-win.zip and copy ninja.exe to C:\Program Files\CMake\bin.

Download Skia

  • Download Skia Skia-Windows-Release-x64.zip.

  • In the C:\ directory, create a folder named deps.

  • Inside the deps directory, create another folder named skia.

  • Extract the contents of Skia-Windows-Release-x64.zip into the skia folder.

Compiling

  • In the C:\ directory, create a folder named aseprite.

  • Extract the contents of Aseprite-v1.x-Source.zip into the aseprite folder.

  • Search Command Prompt

  • Execute the following commands:

call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\VsDevCmd.bat" -arch=x64
cd C:\aseprite
mkdir build
cd build
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 ..
ninja aseprite
  • If CMake is unable to detect the compiler:

    • Execute the following command instead:
    cmake -DCMAKE_CXX_COMPILER="C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\cl.exe" -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 ..
  • The executable will be located at C:\aseprite\build\bin\aseprite.exe.

Tested With Aseprite v1.3.7

Please remember to support the creators of Aseprite. Only use this method to try the program or if you don't have access to funds or a credit card :)

@agajgjsa592586
Copy link

Sadly. It didn't work for me... :(

@agajgjsa592586
Copy link

Sadly. It didn't work for me... :(

Here is the error I've got. CMake Error at build/CMakeFiles/3.25.1/CMakeCXXCompiler.cmake:1 (set):
Syntax error in cmake code at

/c/aseprite/build/CMakeFiles/3.25.1/CMakeCXXCompiler.cmake:1

when parsing string

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe

Invalid character escape '\P'.
Call Stack (most recent call first):
CMakeLists.txt:25 (project)

CMake Error at CMakeLists.txt:25 (project):
The CMAKE_CXX_COMPILER:

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.

@VermeilChan
Copy link
Author

Sadly. It didn't work for me... :(

Here is the error I've got. CMake Error at build/CMakeFiles/3.25.1/CMakeCXXCompiler.cmake:1 (set): Syntax error in cmake code at

/c/aseprite/build/CMakeFiles/3.25.1/CMakeCXXCompiler.cmake:1

when parsing string

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe

Invalid character escape '\P'. Call Stack (most recent call first): CMakeLists.txt:25 (project)

CMake Error at CMakeLists.txt:25 (project): The CMAKE_CXX_COMPILER:

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

I don't have this issue, it should automatically detect it. I'll add a new command in case this happens for more ppl

@agajgjsa592586
Copy link

Sadly. It didn't work for me... :(

Here is the error I've got. CMake Error at build/CMakeFiles/3.25.1/CMakeCXXCompiler.cmake:1 (set): Syntax error in cmake code at

/c/aseprite/build/CMakeFiles/3.25.1/CMakeCXXCompiler.cmake:1

when parsing string

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe

Invalid character escape '\P'. Call Stack (most recent call first): CMakeLists.txt:25 (project)
CMake Error at CMakeLists.txt:25 (project): The CMAKE_CXX_COMPILER:

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe

is not a full path and was not found in the PATH.
Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

I don't have this issue, it should automatically detect it. I'll add a new command in case this happens for more ppl

My laptop hates me when I compile something. Like GitHub/git...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment