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

Function make_build_optimizer

ci/meson/build_optimizer.py:172–192  ·  view source on GitHub ↗

Create a BuildOptimizer with an appropriate cache file path for the given build directory. The cache file name is derived from the build directory name (e.g., "meson-quick") so different build modes (quick/debug/release) maintain separate fingerprint caches. Args: build_di

(
    build_dir: Path, cache_root: Optional[Path] = None
)

Source from the content-addressed store, hash-verified

170
171
172def make_build_optimizer(
173 build_dir: Path, cache_root: Optional[Path] = None
174) -> BuildOptimizer:
175 """
176 Create a BuildOptimizer with an appropriate cache file path for the given build directory.
177
178 The cache file name is derived from the build directory name (e.g., "meson-quick")
179 so different build modes (quick/debug/release) maintain separate fingerprint caches.
180
181 Args:
182 build_dir: The meson build directory (e.g., .build/meson-quick)
183 cache_root: Directory for cache files (defaults to .cache/ relative to CWD)
184
185 Returns:
186 BuildOptimizer instance with loaded saved fingerprints
187 """
188 if cache_root is None:
189 cache_root = Path(".cache")
190 mode_name = build_dir.name # e.g., "meson-quick"
191 cache_file = cache_root / f"build_optimizer_{mode_name}.json"
192 return BuildOptimizer(cache_file=cache_file)

Callers 1

run_meson_build_and_testFunction · 0.90

Calls 1

BuildOptimizerClass · 0.85

Tested by

no test coverage detected