Commit b2e5d86
authored
[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`.1 parent ea62bcc commit b2e5d86
2 files changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| |||
0 commit comments