You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The macros must build for the local machine running the build, not the
machine that Swift-Foundation will run on, in order for the build to be
able to use the macros.
To do this, the macro build must use ExternalProject, which treats the
child project as an entirely independent project. One cannot introspect
into the external project since it is configured at build time, rather
than at configure time. This is what allows the external project to
build for another platform.
The expectation is that the calling project will pull the built products
of the ExternalProject from the install location. EPs have an internal
implicit install prefix where they can install stuff to without dirtying
the building machine or installed products, so we can make use of that.
In order for that to work, the products must actually get installed
though, so we have to install the FoundationMacros, even when built as
an executable. To support that, I've exposed an option to tell the
macro build to build the macros as an executable.
On the library side, I've exposed the Foundation macros as an interface
library that only exposes the `-load-plugin-path` option needed for
picking up the macro. Linking against this interface library will load
the plugin as desired.
This results in a build that
- can use macros, even when cross-compiling.
- does not install the macros into the installed library, only to the
build directory.
0 commit comments