thebrowsercompany / windows-samples

Sample Apps for Swift on Windows
MIT License
262 stars 13 forks source link

ARM 64 Support #8

Closed omrd closed 8 months ago

omrd commented 8 months ago

Has anyone been able to get this to run on an M series Mac? I am trying to run one of the samples using Parallels. Followed all installation instructions but always get this error.

This platform (arm64-win32) is not suported. (Don't know why supported is mispelled as such but it is).

Any help would be greatly appreciated.

StefanCosminR commented 8 months ago

I have the exact same setup and I managed to get it to build, you need at least two things.

  1. A Swift toolchain newer than what's on Swift.org, you can install one from swift-build repository from thebrowsercompany.

  2. Run the build command from x64 Visual Studio Command Prompt so you will create a x64 executable

omrd commented 8 months ago

Is Visual Studio different than VSCode Command Prompt? I have tried both with no luck.

Also which command specifically? I have tried swift run and cmake --build --preset debug. Neither will build. I get a whole lot of errors.

StefanCosminR commented 8 months ago

Yes, I can't build it with VSCode either. I wouldn't say it's a viable development environment, more like a proof of concept.

Try the following steps:

  1. Make sure you have installed or the requirements from the readme
    Requirements
    (ignore this) Install latest Swift SDK from https://www.swift.org/download/ (this link is wrong, see step 2)
    Install latest CMake: winget install --id Kitware.CMake
    Windows SDK 10.0.20348.0: https://go.microsoft.com/fwlink/?linkid=2164145
    Visual Studio Community with C++ build tools
  2. Get the installer-amd64 from https://github.com/thebrowsercompany/swift-build/releases
    • you need to be careful and download the AMD64, not the ARM version
    • you might need to uninstall the current swift toolchain, I don't think it can overwrite it
  3. Clone this repo
  4. From Windows search, go to "x64 Native Tools Command Prompt for VS 2022". This will open a terminal window. Screenshot 2023-12-22 at 10 09 46
  5. Type cd "the_path_to_your_clone_repo/WinUI3AnimationsPreview" (the build commands don't work from the root of the repo, you need to be in the WinUI3AnimationsPreview subfolder)
  6. Run cmake --preset debug
  7. Run cmake --build --preset debug

If anything fails, the most likely scenario is that you installed some ARM dependency, either the Swift toolchain, or the Windows SDK or maybe something else. Try running every terminal command from the x64 Native Tools one, you can even install dependencies with WinGet from this one I think.

omrd commented 8 months ago

I have to agree that this doesn't seem development ready, unfortunately. I was really looking forward to it.

So far I'm still not able to compile anything. Hopefully it'll be maintained further.