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

Function _get_independently_compiled_dirs

ci/lint_cpp/test_unity_build.py:169–195  ·  view source on GitHub ↗

Determine which directories are independently compiled by build files in src/fl/build/. Returns: Set of directory paths relative to src/ (e.g., {"", "fl", "fl/audio", "platforms", ...})

(src_dir: Path)

Source from the content-addressed store, hash-verified

167
168
169def _get_independently_compiled_dirs(src_dir: Path) -> set[str]:
170 """
171 Determine which directories are independently compiled by build files in src/fl/build/.
172
173 Returns:
174 Set of directory paths relative to src/ (e.g., {"", "fl", "fl/audio", "platforms", ...})
175 """
176 build_dir = src_dir / "fl" / "build"
177 if not build_dir.exists():
178 return set()
179
180 dirs: set[str] = set()
181 for build_file in build_dir.glob("*.cpp"):
182 dir_path, _ = _parse_build_filename(build_file.name)
183 dirs.add(dir_path)
184 # Also register every ancestor directory: if "fl/audio" is
185 # independently compiled, then its parent "fl" is implicitly
186 # covered (its subdirs do not need to be re-included from a
187 # higher-level _build.cpp.hpp). This avoids spurious "Missing
188 # subdirectory include" violations when a parent directory has
189 # no flat build file but all its children are independently
190 # compiled via fl.X+.cpp recursive builds.
191 parent = dir_path
192 while "/" in parent:
193 parent = parent.rsplit("/", 1)[0]
194 dirs.add(parent)
195 return dirs
196
197
198def _get_namespace_path(file_path: Path, src_dir: Path) -> str | None:

Callers 1

scanFunction · 0.85

Calls 3

_parse_build_filenameFunction · 0.85
setClass · 0.50
addMethod · 0.45

Tested by

no test coverage detected