Description
Description
When building Swift on a Windows ARM64 machine, CMAKE_SYSTEM_PROCESSOR
will sometimes have a value of AMD64
instead of ARM64
causing the build to fail.
Note that this only happens when selecting the individual components of MSVC in the Visual Studio Installer instead of installing the C++ Workload directly. Using VS' version of CMake instead of installing it manually also seems to make a difference.
Installing the C++ Workload or VS' CMake will automatically install MSVC v14.44, which will cause the following issue: #79852.
We need to install component by component in order to use 14.42.
Reproduction
- Install MVSC 14.42 on an ARM64 machine.
- Run
build.ps1
. - Notice that
CMAKE_SYSTEM_PROCESSOR
is set toAMD64
.
This will try to link against x86 libraries.
Expected behavior
CMAKE_SYSTEM_PROCESSOR
should be set to ARM64
and the build should succeed.
Environment
I am building the release/6.2
branch.
Additional information
This is a known issue with CMake on Windows: https://gitlab.kitware.com/cmake/cmake/-/issues/15170#note_891234
Setting the value manually fixes the problem.