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

Function needs_linking

ci/wasm_compile_native.py:105–137  ·  view source on GitHub ↗

Check if linking is needed by comparing timestamps. Args: sketch_object: Sketch .o file library_archive: Library .a archive (includes entry_point via _build.hpp) output_wasm: Output .wasm file Returns: True if linking is needed, False if output is up-to

(
    sketch_object: Path,
    library_archive: Path,
    output_wasm: Path,
)

Source from the content-addressed store, hash-verified

103
104
105def needs_linking(
106 sketch_object: Path,
107 library_archive: Path,
108 output_wasm: Path,
109) -> bool:
110 """
111 Check if linking is needed by comparing timestamps.
112
113 Args:
114 sketch_object: Sketch .o file
115 library_archive: Library .a archive (includes entry_point via _build.hpp)
116 output_wasm: Output .wasm file
117
118 Returns:
119 True if linking is needed, False if output is up-to-date
120 """
121 # If output doesn't exist, we need to link
122 if not output_wasm.exists():
123 return True
124
125 # Get output modification time
126 output_mtime = output_wasm.stat().st_mtime
127
128 # Check if any input is newer than output
129 inputs = [sketch_object, library_archive]
130 for input_file in inputs:
131 if not input_file.exists():
132 return True # Input missing, need to link
133 if input_file.stat().st_mtime > output_mtime:
134 return True # Input is newer, need to link
135
136 # All inputs are older than output, no linking needed
137 return False
138
139
140def needs_compilation(source_file: Path, output_object: Path) -> bool:

Callers 1

compile_wasmFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected