fbuild's ``cc_flags`` mixes ``-D``/``-I`` in; split them back out. Returns a :class:`SplitFlags` with pure compiler flags, defines (``-D`` prefix stripped to match PIO's format), and includes (``-I`` prefix stripped).
(cc_flags: list[str])
| 231 | |
| 232 | |
| 233 | def _split_fbuild_combined_flags(cc_flags: list[str]) -> SplitFlags: |
| 234 | """fbuild's ``cc_flags`` mixes ``-D``/``-I`` in; split them back out. |
| 235 | |
| 236 | Returns a :class:`SplitFlags` with pure compiler flags, defines (``-D`` |
| 237 | prefix stripped to match PIO's format), and includes (``-I`` prefix |
| 238 | stripped). |
| 239 | """ |
| 240 | pure: list[str] = [] |
| 241 | defines: list[str] = [] |
| 242 | includes: list[str] = [] |
| 243 | for raw in cc_flags: |
| 244 | if raw.startswith("-D"): |
| 245 | defines.append(raw[2:]) |
| 246 | elif raw.startswith("-I"): |
| 247 | includes.append(raw[2:]) |
| 248 | else: |
| 249 | pure.append(raw) |
| 250 | return SplitFlags(pure=pure, defines=defines, includes=includes) |
| 251 | |
| 252 | |
| 253 | def _clean_flags(flags: list[str]) -> set[str]: |
no test coverage detected