Compile without msvc

like rust,it can choose which one i prefers,i can unistall stable-x86_64-pc-windows-msvc,and using stable-x86_64-pc-windows-gnu,its possible on now ?

AFAIK this is not possible for now. IMHO it would be great to get rid of Microsoft Visual Studio. But again AFAIK MS Visual Studio (or rather Build Tools, including Windows SDK) are required by Clang, not Swift itself. I may be wrong, as Rust is also Clang based, and it can get away without MS things?

1 Like

The Windows SDK is required to access the Windows APIs. If you do not need to interact with Windows, you do not need the Windows SDK.

The MSVC Build Tools are required to access the C runtime headers. The Swift runtime itself depends on C and C++ and as such will require the C headers.

If you provide your own SDK that has a runtime which does not depend on C/C++ and you do not need to access the Windows APIs, you can certainly use the x86_64-unknown-windows-msvc triple to target Windows without those dependencies. You would of course still need the MSVC runtime installed as the compiler depends on that.

4 Likes