Skip to content

Instantly share code, notes, and snippets.

@VermeilChan
Last active December 26, 2024 18:56
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 ..
  • Now compile with Ninja Build System:
ninja aseprite
  • If CMake is unable to detect the C/C++ compiler:

    • Execute the following command instead:
    cmake -DCMAKE_CXX_COMPILER="C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\Hostx64\x64\cl.exe" -DCMAKE_C_COMPILER="C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\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.9.1

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 :)

@Baderzzz
Copy link

Baderzzz commented Dec 5, 2024

Hello! I've been trying to compile Aseprite for the past few days, but nothing is working. So basically, I installed everything and put the files in their respective folders, but when I tried compiling it, it started good, but then...:

-- The C compiler identification is MSVC 19.41.34123.0
-- The CXX compiler identification is MSVC 19.41.34123.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe
-- Check for working C compiler: /c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe - broken
CMake Error at /opt/devkitpro/msys2/usr/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler

"/c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe"

is not able to compile a simple test program.
It fails with the following output:

Change Dir: '/c/aseprite/build/CMakeFiles/CMakeScratch/TryCompile-a9HHZB'

Run Build Command(s): "/c/Program Files/CMake/bin/ninja.exe" -v cmTC_a0313
ninja: error: '/c/aseprite/build/CMakeFiles/CMakeScratch/TryCompile-a9HHZB/testCCompiler.c', needed by 'CMakeFiles/cmTC_a0313.dir/testCCompiler.c.o', missing and no known rule to make it

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:23 (project)
-- Configuring incomplete, errors occurred!

Then I tried again but using the command that is used in case CMake is unable to detect the C/C++ compiler, and this happened:

CMake Error at build/CMakeFiles/3.30.1/CMakeCCompiler.cmake:2 (set):
Syntax error in cmake code at

/c/aseprite/build/CMakeFiles/3.30.1/CMakeCCompiler.cmake:2

when parsing string

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

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

And now for some reason, even when using the normal command, it also does this second error, any idea on why this is happening?

Heyyy its probably too late but just for anyones future reference, peep this line:
" CMake Error at /opt/devkitpro/msys2/usr/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message):"
It seems you have devkitpro installed, and it seems to conflict with aseprite with some reason. The solution I found was to exclude it from the windows PATH variable, you can also try uninstalling it.

Cheers!

@Cledosvaldo
Copy link

Hello! I've been trying to compile Aseprite for the past few days, but nothing is working. So basically, I installed everything and put the files in their respective folders, but when I tried compiling it, it started good, but then...:

-- The C compiler identification is MSVC 19.41.34123.0
-- The CXX compiler identification is MSVC 19.41.34123.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe
-- Check for working C compiler: /c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe - broken
CMake Error at /opt/devkitpro/msys2/usr/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler

"/c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe"

is not able to compile a simple test program.
It fails with the following output:

Change Dir: '/c/aseprite/build/CMakeFiles/CMakeScratch/TryCompile-a9HHZB'

Run Build Command(s): "/c/Program Files/CMake/bin/ninja.exe" -v cmTC_a0313
ninja: error: '/c/aseprite/build/CMakeFiles/CMakeScratch/TryCompile-a9HHZB/testCCompiler.c', needed by 'CMakeFiles/cmTC_a0313.dir/testCCompiler.c.o', missing and no known rule to make it

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:23 (project)
-- Configuring incomplete, errors occurred!

Then I tried again but using the command that is used in case CMake is unable to detect the C/C++ compiler, and this happened:

CMake Error at build/CMakeFiles/3.30.1/CMakeCCompiler.cmake:2 (set):
Syntax error in cmake code at

/c/aseprite/build/CMakeFiles/3.30.1/CMakeCCompiler.cmake:2

when parsing string

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

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

And now for some reason, even when using the normal command, it also does this second error, any idea on why this is happening?

Heyyy its probably too late but just for anyones future reference, peep this line: " CMake Error at /opt/devkitpro/msys2/usr/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message):" It seems you have devkitpro installed, and it seems to conflict with aseprite with some reason. The solution I found was to exclude it from the windows PATH variable, you can also try uninstalling it.

Cheers!

It's not too late, I was still trying to figure this out, thanks a lot!! Gonna try out soon!!! :D

@Cledosvaldo
Copy link

Hello! I've been trying to compile Aseprite for the past few days, but nothing is working. So basically, I installed everything and put the files in their respective folders, but when I tried compiling it, it started good, but then...:

-- The C compiler identification is MSVC 19.41.34123.0
-- The CXX compiler identification is MSVC 19.41.34123.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe
-- Check for working C compiler: /c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe - broken
CMake Error at /opt/devkitpro/msys2/usr/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler

"/c/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/HostX64/x64/cl.exe"

is not able to compile a simple test program.
It fails with the following output:

Change Dir: '/c/aseprite/build/CMakeFiles/CMakeScratch/TryCompile-a9HHZB'

Run Build Command(s): "/c/Program Files/CMake/bin/ninja.exe" -v cmTC_a0313
ninja: error: '/c/aseprite/build/CMakeFiles/CMakeScratch/TryCompile-a9HHZB/testCCompiler.c', needed by 'CMakeFiles/cmTC_a0313.dir/testCCompiler.c.o', missing and no known rule to make it

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:23 (project)
-- Configuring incomplete, errors occurred!

Then I tried again but using the command that is used in case CMake is unable to detect the C/C++ compiler, and this happened:

CMake Error at build/CMakeFiles/3.30.1/CMakeCCompiler.cmake:2 (set):
Syntax error in cmake code at

/c/aseprite/build/CMakeFiles/3.30.1/CMakeCCompiler.cmake:2

when parsing string

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

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

And now for some reason, even when using the normal command, it also does this second error, any idea on why this is happening?

Heyyy its probably too late but just for anyones future reference, peep this line: " CMake Error at /opt/devkitpro/msys2/usr/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message):" It seems you have devkitpro installed, and it seems to conflict with aseprite with some reason. The solution I found was to exclude it from the windows PATH variable, you can also try uninstalling it.

Cheers!

So, now that there's no devkitpro, a totally different result happened, any idea what does it mean?
https://pastebin.com/DhrsSfbU (Password: HR7YMCgRKA)

@Cledosvaldo
Copy link

Just found the problem, as I'm using an Aseprite beta branch, I simply needed to use Skia-m124 lol. But anyways, thanks a lot for the devkitpro thing, that fixed the problem from before. =D

@Baderzzz
Copy link

Baderzzz commented Dec 6, 2024

Just found the problem, as I'm using an Aseprite beta branch, I simply needed to use Skia-m124 lol. But anyways, thanks a lot for the devkitpro thing, that fixed the problem from before. =D

No worries! Glad I could help

@LiterallyWize
Copy link

when i run ninja aseprite my cpu usage skyrockets, i'm pretty sure it's using my cpu to it's fullest for no reason, i wasn't aware the first time and my pc crashed even though it's a stable computer
the second time i ran it with hwinfo open and i saw that my cpu temps go up to 110c which is insane, had to immediately ctrl+c

am i doing something wrong? is there any way to set a limit on how ninja uses my cpu? i couldn't find anything online that was helpful about this

@VermeilChan
Copy link
Author

when i run ninja aseprite my cpu usage skyrockets, i'm pretty sure it's using my cpu to it's fullest for no reason, i wasn't aware the first time and my pc crashed even though it's a stable computer the second time i ran it with hwinfo open and i saw that my cpu temps go up to 110c which is insane, had to immediately ctrl+c

am i doing something wrong? is there any way to set a limit on how ninja uses my cpu? i couldn't find anything online that was helpful about this

well you are compiling a program thats really how it is, it uses 100% of your cpu

@LiterallyWize
Copy link

when i run ninja aseprite my cpu usage skyrockets, i'm pretty sure it's using my cpu to it's fullest for no reason, i wasn't aware the first time and my pc crashed even though it's a stable computer the second time i ran it with hwinfo open and i saw that my cpu temps go up to 110c which is insane, had to immediately ctrl+c
am i doing something wrong? is there any way to set a limit on how ninja uses my cpu? i couldn't find anything online that was helpful about this

well you are compiling a program thats really how it is, it uses 100% of your cpu

i dunno what kinda sorcery powered computer y'all are using for it to not fry your cpu when ninja uses like 32 cores by default when compiling
that aside i just put a flag in it by doing ninja -j4 aseprite to limit the core usage to 4 n it worked out

@VermeilChan
Copy link
Author

when i run ninja aseprite my cpu usage skyrockets, i'm pretty sure it's using my cpu to it's fullest for no reason, i wasn't aware the first time and my pc crashed even though it's a stable computer the second time i ran it with hwinfo open and i saw that my cpu temps go up to 110c which is insane, had to immediately ctrl+c
am i doing something wrong? is there any way to set a limit on how ninja uses my cpu? i couldn't find anything online that was helpful about this

well you are compiling a program thats really how it is, it uses 100% of your cpu

i dunno what kinda sorcery powered computer y'all are using for it to not fry your cpu when ninja uses like 32 cores by default when compiling that aside i just put a flag in it by doing ninja -j4 aseprite to limit the core usage to 4 n it worked out

nah bro my pc has 4 cores 😭. great

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