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
[lit] Use CMAKE_C_FLAGS and CMAKE_EXE_LINKER_FLAGS when compiling test plugin (#70136)
In cases where the swift-plugin-server is built with specialized `CMAKE_C_FLAGS`
and/or `CMAKE_EXE_LINKER_FLAGS`, if one wants to load a plugin in it,
one needs to build with a compatible set of flags, or the plugin will
not be able to be loaded.
Most of the time the tests can build against the `/` sysroot and be
fine, but in the case of these test plugins, since they have to be
loaded into the swift-plugin-server process, they need to compiled and
linked in a compatible way. Using `CMAKE_C_FLAGS` and
`CMAKE_EXE_LINKER_FLAGS` uses the same set of flags in both cases, and
allow loading these test plugins during testing and avoid failures.
The change in `lit.site.cfg.in` embeds the values of `CMAKE_C_FLAGS` and
`CMAKE_EXE_LINKER_FLAGS` from CMake into the Lit configuration. The
usage of raw triple quoted strings allow single and double quoted
arguments to survive the interpolation.
The change in `lit.local.cfg` creates two substitutions for them, and
uses those substitutions in `swift-build-cxx-plugin`.
0 commit comments