I'm wondering if it's possible to build a custom Swift toolchain for just macOS. I'm trying to create a minimal toolchain for use with Xcode Playgrounds and want to disable other SDKs (iOS, tvOS, watchOS).
Does it make sense to create a macOS-only toolchain? Is there a standard way to do this using utils/build-toolchain or related scripts? Currently, I'm commenting out flags for other SDKs in build-presets.ini and running build-toolchain.
Yes, you can certainly do this by creating a preset that only builds the macOS libraries and overlays. In theory one could slim down further if you’re willing to hack out code more aggressively to, e.g., remove the ARM backends... but that would only affect the binary size of the compiler.
I see that build-toolchain uses the buildbot_osx_package overlay, which in turn uses the mixin_osx_package_base overlay. I tried commenting out ios/tvos/watchosthere but encountered an issue when building overlays:
I see that Accelerate/CMakeLists.txt lists many TARGET_SDKS in addition to OSX - could that perhaps be the source of the problem? I thought that removing the SDK flags in build_presets.ini would propagate through the build.