compnerd / swift-win32

A Windows application framework for Swift
https://compnerd.github.io/swift-win32/
BSD 3-Clause "New" or "Revised" License
1.1k stars 69 forks source link

Unrecognised architecture on host system: ARM64 #732

Closed efalloon closed 1 year ago

efalloon commented 1 year ago

While building the project with cmake, I get an unexpected error that I can only assume has something to do with my laptop CPU architecture. Currently, I'm running a Parallels VM of Windows 11 on a M1 Max MacBook Pro.

As such, I could not find the ARM64 CPU type listed under .\cmake\Modules\SwiftSupport.cmake. Is this something that can be altered to support Apple Silicon Macs (running a VM)?

The error occurred while running the suggested session line: cmake -B build -D BUILD_SHARED_LIBS=YES -D CMAKE_BUILD_TYPE=Release -D CMAKE_Swift_FLAGS="-sdk %SDKROOT%" -G Ninja -S .

This was the output at the end:

CMake Error at cmake/Modules/SwiftSupport.cmake:41 (message):
  Unrecognized architecture on host system: ARM64
Call Stack (most recent call first):
  cmake/Modules/SwiftSupport.cmake:80 (get_swift_host_arch)
  Packages/swift-collections/Sources/Collections/CMakeLists.txt:18 (_install_target)

-- Configuring incomplete, errors occurred!
See also "C:/dev/swift/sandbox/swift-win32/build/CMakeFiles/CMakeOutput.log".
See also "C:/dev/swift/sandbox/swift-win32/build/CMakeFiles/CMakeError.log".

Please also see the CMakeError.log file attached. CMakeError.log

efalloon commented 1 year ago

I have made a pull request which addresses the issue: https://github.com/compnerd/swift-win32/pull/733#issue-1549172111