MCPcopy Create free account
hub / github.com/FastLED/FastLED / _split_fbuild_combined_flags

Function _split_fbuild_combined_flags

ci/check_backend_flag_drift.py:233–250  ·  view source on GitHub ↗

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])

Source from the content-addressed store, hash-verified

231
232
233def _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
253def _clean_flags(flags: list[str]) -> set[str]:

Callers 1

normalize_build_infoFunction · 0.85

Calls 2

SplitFlagsClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected