Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Windows ARM64 Detection #803

Closed
wants to merge 1 commit into from
Closed

Conversation

hmelder
Copy link

@hmelder hmelder commented Dec 2, 2023

CMAKE_SYSTEM_PROCESSOR returns ARM64 and not aarch64 (cmake version 3.27.9).

systeminfo:

OS Name:                   Microsoft Windows 11 Pro
OS Version:                10.0.22598 N/A Build 22598
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
System Type:               ARM64-based PC

@@ -6,7 +6,7 @@ function(dispatch_windows_arch_spelling arch var)
set(${var} x64 PARENT_SCOPE)
elseif(${arch} STREQUAL armv7)
set(${var} arm PARENT_SCOPE)
elseif(${arch} STREQUAL aarch64)
elseif(${arch} STREQUAL aarch64 OR ${arch} STREQUAL ARM64)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use MATCHES? I'm not sure how I didn't hit this though as I've been using Swift on Windows ARM64 for a while.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am running on a prerelease version from late 2022, maybe they changed the architecture name later on.

Why not use MATCHES?

I was just adapting the method used for x64 and AMD64 detection. Should I change it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@triplef
Copy link
Contributor

triplef commented Dec 12, 2023

Would there be a simple way to also support cross-compiling on Windows using the respective VS environments e.g. by looking at the VSCMD_ARG_TGT_ARCH env var instead of CMAKE_SYSTEM_PROCESSOR? Not sure what’s the common CMake thing to do on Windows, but personally I would expect it to build for whatever VS environment I am using.

triplef pushed a commit to gnustep/tools-windows-msvc that referenced this pull request Dec 28, 2023
triplef pushed a commit to gnustep/tools-windows-msvc that referenced this pull request Dec 28, 2023
@hmelder
Copy link
Author

hmelder commented Feb 15, 2024

@compnerd Given the previous use of OR instead of MATCHES how should I move on with this?

@compnerd
Copy link
Collaborator

Eh, I suppose that it is fine as is.

@compnerd
Copy link
Collaborator

@swift-ci please test

@compnerd
Copy link
Collaborator

Hmm, actually, is this still needed after #812?

@hmelder
Copy link
Author

hmelder commented Feb 15, 2024

Hmm, actually, is this still needed after #812?

Nope

@hmelder hmelder closed this Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants