Skip to content

Instantly share code, notes, and snippets.

@VermeilChan
Last active May 15, 2024 13:28
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 System PATH For All Users

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
  • The executable will be located at C:\aseprite\build\bin\aseprite.exe.

Tested With Aseprite v1.3.6

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

@Dcyyr
Copy link

Dcyyr commented Mar 1, 2024

1
Why am i got this,I've never used CMake.

@StarFang208
Copy link

StarFang208 commented Mar 11, 2024

I'm getting errors when I follow the instructions.
C:\aseprite\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 ..
CMake Error at C:/Program Files/CMake/share/cmake-3.28/Modules/CMakeDetermineCXXCompiler.cmake:48 (message):
Could not find compiler set in environment variable CXX:

set(CMAKE_CXX_COMPILER "C:/Program Files/Microsoft Visual
Studio/2022/Community/VC/Tools/MSVC/14.30.30705/bin/Hostx64/x64/cl.exe").

Call Stack (most recent call first):
CMakeLists.txt:23 (project)

CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

How can I fix it?

I'm on Win 10 anyway.

@mrstakan1
Copy link

Hi. Im getting this error with any compiler im trying to use. Maybe you can help me. I`m on Windows 11.

C:\aseprite\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 ..
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- 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.39.33519/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.29/Modules/CMakeTestCCompiler.cmake:67 (message):
The C compiler

"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/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-7uvaq3'

Run Build Command(s): C:/PROGRA~1/MIB055~1/2022/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe -v cmTC_7395d
[1/2] C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1439~1.335\bin\Hostx64\x64\cl.exe    -o CMakeFiles\cmTC_7395d.dir\testCCompiler.c.obj -c C:\aseprite\build\CMakeFiles\CMakeScratch\TryCompile-7uvaq3\testCCompiler.c
FAILED: CMakeFiles/cmTC_7395d.dir/testCCompiler.c.obj
C:\PROGRA~1\MIB055~1\2022\COMMUN~1\VC\Tools\MSVC\1439~1.335\bin\Hostx64\x64\cl.exe    -o CMakeFiles\cmTC_7395d.dir\testCCompiler.c.obj -c C:\aseprite\build\CMakeFiles\CMakeScratch\TryCompile-7uvaq3\testCCompiler.c
ninja: build stopped: subcommand failed.

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:23 (project)

-- Configuring incomplete, errors occurred!

@YagamiD3v
Copy link

Thanks !

@thekaz
Copy link

thekaz commented Apr 7, 2024

This might be a dumb or obvious prereq, but I think this process also requires git to be installed. Otherwise the error "error: could not find git for clone..." appears. If this is someone's first time trying to compile something, or if they're a starving artist with no dev experience, they may not know how to parse the error message.

@thekaz
Copy link

thekaz commented Apr 7, 2024

@KilkankB I figured out how to fix your error if you're still having it. From https://community.aseprite.org/t/cmake-error-webp-libraries-notfound/17305, double check your skia install directory, and where it is in your filesystem matches -DSKIA_DIR=C:\deps\skia. If it doesn't, either move the directory or update the flag to match where it actually is

@VermeilChan
Copy link
Author

sorry guys if i dont reply to ur problems
im not that smart 😭

@Dotsz-Vic-FLP
Copy link

Appreciate this guide. This is way easier to understand than the install.md included. Thank you for this.

@VermeilChan
Copy link
Author

Appreciate this guide. This is way easier to understand than the install.md included. Thank you for this.

thank you :)

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