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

Function ensure_library_built

ci/wasm_compile_native.py:40–75  ·  view source on GitHub ↗

Ensure libfastled.a is up-to-date by calling wasm_build_library.py. Args: build_mode: Build mode to pass to library build verbose: Enable verbose output force: Force rebuild of library unity_chunks: Number of unity build chunks (0 = disabled) Returns:

(
    build_mode: str,
    verbose: bool = False,
    force: bool = False,
    unity_chunks: int = 0,
)

Source from the content-addressed store, hash-verified

38
39
40def ensure_library_built(
41 build_mode: str,
42 verbose: bool = False,
43 force: bool = False,
44 unity_chunks: int = 0,
45) -> bool:
46 """
47 Ensure libfastled.a is up-to-date by calling wasm_build_library.py.
48
49 Args:
50 build_mode: Build mode to pass to library build
51 verbose: Enable verbose output
52 force: Force rebuild of library
53 unity_chunks: Number of unity build chunks (0 = disabled)
54
55 Returns:
56 True if successful
57 """
58 print("Checking library build...")
59 cmd = [
60 "uv",
61 "run",
62 "python",
63 str(PROJECT_ROOT / "ci" / "wasm_build_library.py"),
64 "--mode",
65 build_mode,
66 ]
67 if verbose:
68 cmd.append("--verbose")
69 if force:
70 cmd.append("--force")
71 if unity_chunks > 0:
72 cmd.extend(["--unity-chunks", str(unity_chunks)])
73
74 result = subprocess.run(cmd, cwd=PROJECT_ROOT)
75 return result.returncode == 0
76
77
78def create_wrapper_for_example(example_name: str, output_path: Path) -> Path:

Callers 1

compile_wasmFunction · 0.85

Calls 3

printFunction · 0.50
appendMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected