-
-
Notifications
You must be signed in to change notification settings - Fork 61
Description
A release build of CounterExample currently takes about 3 minutes to compile on an M2 MacBook Air. Much is spent building SwiftCrossUI and its dependencies. The actual app doesn't take much time to compile at all.
On macOS we can probably ship a binaryTarget containing a build of SwiftCrossUI. On Linux and Windows I believe that binaryTargets can at least ship static libraries on Linux and Windows, but that's not very useful for us cause we need to link against system libraries such as Gtk and WinUI. On Linux we could ship SwiftCrossUI itself as a static library and get clients to compile GtkBackend (which shouldn't be too expensive?). On Windows we should ideally find a way to ship WinUIBackend as pre-built dlls, because it's quite the beast to compile, and dominates SwiftCrossUI compilation times on Windows.
Maybe on supported platforms we could have a "SwiftCrossUI" binaryTarget that replaces the regular SwiftCrossUI target when a certain environment variable (e.g. SCUI_PREBUILTS) is set? Our CI could build the prebuilts and then upload them to a server that our binaryTarget can point to. The Package.swift would have to read the commit hash from disk and use it to construct the binaryTarget URL.