Hi. I have a CMake project using C++ which cross compiles to Windows. I would like to add Embedded Swift to it (which does work on macOS) however now I can't cross compile for x86_64-windows-msvc because the toolchain does not include the Swift module for that target. How can I build it myself without modifying the entire toolchain?
Ironically this is a subject @Philippe_Hausler, @dschaefer2, and I discussed yesterday morning!
I would like us to add a Package.swift
to swiftlang/swift
that can be used to build Swift.swiftmodule
. That would allow expert users to try out new arches more easily without needing to muck around with build-script
. It also opens the door for even more specific "slices" to be built for exactly what the user needs, e.g. with PIC or with a specific -mcpu etc...
A future step would be teaching SwiftPM to automatically build this module if the toolchain didn't ship with it, with the ultimate goal of removing the fixed set of modules from the toolchain. Now these are just my preferences and would need agreement from the various owners.
Note: Initially this would only support building for Embedded because building the standard version of Swift.swiftmodule requires mixed C++ & Swift source in the same module, which SwiftPM cannot do (yet)