# Cross target: 64-bit ARM Windows via llvm-mingw (aarch64-w64-mingw32).
#
# Composed as
#   conan install . -pr:b profiles/native -pr:h profiles/aarch64-mingw-llvm-w64 --build=missing
#   cmake --workflow --preset aarch64-mingw-llvm-w64-release
#
# Pinned toolchain: llvm-mingw 20260616 (LLVM 22.1.8), UCRT build. The
# compiler.version below is read from the compiler itself, and clang 23 is
# rejected by Conan until its settings.yml lists it.
#
# llvm-mingw, not MinGW-w64 GCC: binutils/gcc have no aarch64-w64-mingw32
# target, so clang is the only option here. llvm-mingw does install
# aarch64-w64-mingw32-gcc and -g++ as compatibility wrappers, but they are
# clang underneath, so compiler=clang is what actually describes the binary.
#
# The UCRT build of llvm-mingw needs no -mucrt; the flag is a MinGW-w64 GCC
# driver option.
#
# Change build_folder_vars here and it breaks the matching presets'
# toolchainFile, which points at
# build/windows-armv8-<build type>/generators/conan_toolchain.cmake.

{% set compiler, version, compiler_exe = detect_api.detect_clang_compiler("aarch64-w64-mingw32-clang") %}

[settings]
os=Windows
arch=armv8
compiler=clang
compiler.version={{ detect_api.default_compiler_version(compiler, version) }}
compiler.cppstd=23
compiler.cstd=23
compiler.libcxx=libc++
build_type=Release

[conf]
tools.cmake.cmaketoolchain:generator=Ninja
tools.cmake.cmaketoolchain:user_toolchain=["{{ os.path.join(profile_dir, "..", "cmake", "toolchains", "aarch64-mingw-llvm-w64.cmake") }}"]
tools.cmake.cmake_layout:build_folder_vars=["settings.os", "settings.arch", "settings.build_type"]

tools.build:compiler_executables={"c": "aarch64-w64-mingw32-clang", "cpp": "aarch64-w64-mingw32-clang++"}

tools.build:skip_test=True
