Problem
CMake
provides a built-in flag CMAKE_SYSTEM_PROCESSOR
to specify the target platform for the build.
https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_PROCESSOR.html
CMAKE_SYSTEM_PROCESSOR
flag is derived from environment variables PROCESSOR_ARCHITECTURE
and PROCESSOR_ARCHITEW6432
. And for emulated CMake, the environment variables could be set to AMD64 or IA32 and CMAKE_SYSTEM_PROCESSOR
derives the wrong value.
And if your CMake project uses CMAKE_SYSTEM_PROCESSOR
for platform-specific configuration it might fail.
Solution
You can use native CMake
. There are no official CMake
binaries for Windows Arm64 yet but can be generated from the source https://linaro.atlassian.net/wiki/spaces/WOAR/pages/28684353912/CMake#Build-from-source