Visual Studio and CMake GUI: CMake Presets¶
The repository root contains a CMakePresets.json. It is used in two ways:
CMake GUI (3.19 and later): pick a preset in the Preset drop-down, then Configure, Generate and Open Project. The Visual Studio presets produce a solution (
AviSynth+.slnxwith VS 2026,AviSynth+.slnwith VS 2022) inout\build\<preset>. This replaces choosing generator, platform and toolset by hand in the Configure dialog.Visual Studio Open Folder (File > Open > Folder...; VS Code with the CMake Tools extension as well): the Ninja presets appear in the configuration drop-down of the toolbar. This is the CMake mode of the IDE, not a solution. It is the only way to build the Windows on ARM64 variant from the IDE: the Visual Studio generator can drive the MSVC toolsets only, it cannot cross-compile with llvm-mingw.
Warning
Do not configure into the source folder itself (CMake GUI "Where to build
the binaries" = the repository root). An in-source CMakeCache.txt in the
root breaks Open Folder: Visual Studio passes the root to CMake, which then
takes it for an existing build tree and fails with "generator: Ninja does
not match the generator used previously: Visual Studio 18 2026". Fix: delete
CMakeCache.txt and CMakeFiles\ in the root. With presets every
variant has its own folder under out\build, so this does not happen.
Related documents:
Compiling AviSynth+ — the general build guide.
Automated Dev Build (Visual Studio 2026) —
build_release.bat, all nine release variants in one run. The presets use the same dependency paths and the same ARM64 options.Building AviSynth+'s external dependencies with Visual Studio — building DevIL and SoundTouch.
Building AviSynth+'s external dependencies for Windows on ARM — llvm-mingw and the aarch64 SoundTouch build.
The presets¶
Visual Studio generator presets (a solution; CMake GUI, or cmake --preset):
Preset |
Generator, platform, toolset |
|---|---|
|
VS 18 2026, x64 / Win32, |
|
VS 18 2026, x64 / Win32, |
|
VS 18 2026, x64 / Win32, |
|
VS 18 2026, x64, |
|
VS 17 2022, x64 / Win32, |
Ninja presets (VS Open Folder, or the command line):
Preset |
What it builds |
|---|---|
|
x64, MSVC ( |
|
Windows on ARM64 (aarch64), cross-compiled
with llvm-mingw: MinGW ABI, UCRT. The Debug
preset also writes |
Linux, macOS and BSD: posix-debug and posix-release (default generator
and compiler, default options, like a plain cmake -S . -B build). They are
there for IDEs which switch to presets when a CMakePresets.json exists
(e.g. VS Code CMake Tools); the Windows presets are hidden on these hosts and
vice versa. Command line builds without --preset do not read the file at
all, see Using AviSynth+ on POSIX systems.
Output goes to out\build\<preset> (installs to out\install\<preset>),
which is ignored by git and is separate from avisynth-build and the
build_release.bat folders.
All presets use the options of the matching build_release.bat variant
(plugins on, DirectShowSource off, DevIL and SoundTouch paths). The ARM64
presets: no Intel SIMD, no ImageSeq and VDubFilter, TimeStretch with the
aarch64 SoundTouch library.
CMake GUI¶
Start
cmake-gui. For the Intel preset start it from the oneAPI environment (setvars-vcvarsall.batof oneAPI first, thencmake-gui.exe), otherwise configure fails withCMAKE_LINKER-NOTFOUND."Where is the source code": the repository root.
Preset: choose a variant. "Where to build the binaries" is set by the preset (
out\build\<preset>), leave it.File > Delete Cache for a clean configure (it deletes the cache of that preset's folder only), then Configure and Generate.
Open Project opens the solution of that variant in Visual Studio.
Each variant keeps its own folder and solution, several can exist side by side; switching variants is choosing another preset.
Prerequisites¶
Visual Studio 2022 or 2026 with the C++ CMake tools for Windows component (it brings CMake and Ninja).
The dependencies at the paths used by
build_release.bat:x64:
C:\avsplus_build_deps\DevIL Windows SDKandC:\avsplus_build_deps\v143-x86-64(SoundTouch).ARM64:
C:\avsplus_build_deps\llvm-mingw-20261020-ucrt-x86_64andC:\avsplus_build_deps\mingw-arm64(aarch64 SoundTouch).
Different paths: do not edit CMakePresets.json, put a
CMakeUserPresets.json (it is not tracked by git) next to it, which inherits a
preset and overrides the cache variables:
{
"version": 3,
"configurePresets": [
{
"name": "arm64-mine",
"displayName": "ARM64 llvm-mingw Release (my paths)",
"inherits": "arm64-llvm-mingw-release",
"cacheVariables": {
"AVS_LLVM_MINGW_ROOT": "D:/tools/llvm-mingw-ucrt-x86_64",
"SOUNDTOUCH_LINK_LIBRARIES": "D:/deps/arm64/lib/libSoundTouch.a",
"SOUNDTOUCH_INCLUDE_DIRS": "D:/deps/arm64/include/soundtouch"
}
}
]
}
Without the aarch64 SoundTouch, set "BUILD_TIMESTRETCH": "OFF" there.
Command line¶
The same presets work without the IDE. The Visual Studio generator presets
need no special prompt (except vs-intel-x64: oneAPI environment). For the
x64 MSVC Ninja ones run them from a x64 Native Tools Command Prompt (they use
the compiler found in that environment); the ARM64 ones need only
ninja.exe on PATH:
cmake --preset arm64-llvm-mingw-release
cmake --build --preset arm64-llvm-mingw-release
cmake --list-presets lists them.
What works for ARM64 in the IDE, and what does not¶
Works: configure, build, the error list, IntelliSense with the aarch64 view of the sources (
NEON_INTRINSICSdefined,arm_neon.h, thefilters\aarch64files active).Does not work on an x64 PC: running and debugging. ARM64 binaries do not run on x64 Windows (only the opposite direction is emulated).
Debugging on an ARM64 Windows device: install the Remote Tools for Visual Studio (
msvsmon.exe) there and attach remotely. The Visual Studio debugger needs PDB files; llvm-mingw writes DWARF by default, so the Debug preset adds-gcodeview(CodeView debug info) and-Wl,--pdb=(the linker writesAviSynth.pdbetc. next to the DLLs).
Note
The root CMakeLists.txt sets CMAKE_SHARED_LINKER_FLAGS for MinGW
builds, replacing any value given on the command line. That is why the
Debug preset passes the PDB option through
CMAKE_SHARED_LINKER_FLAGS_DEBUG.
Note
The ARM64 DLLs import libc++.dll and libunwind.dll, llvm-mingw's
C++ runtime, which is not part of Windows. To use a preset build on a
device, copy both from <llvm-mingw>\aarch64-w64-mingw32\bin next to
AviSynth.dll and into the plugin folder (build_release.bat does
this for the release variant).