Skip to content

Can't build Swift on a Windows ARM64 machine because of CMAKE_SYSTEM_PROCESSOR #81836

Closed
@charles-zablit

Description

@charles-zablit

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

  1. Install MVSC 14.42 on an ARM64 machine.
  2. Run build.ps1.
  3. Notice that CMAKE_SYSTEM_PROCESSOR is set to AMD64.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions