Check if source needs recompilation. Args: source_file: Source .cpp file output_object: Output .o file Returns: True if compilation needed, False if up-to-date
(source_file: Path, output_object: Path)
| 138 | |
| 139 | |
| 140 | def needs_compilation(source_file: Path, output_object: Path) -> bool: |
| 141 | """ |
| 142 | Check if source needs recompilation. |
| 143 | |
| 144 | Args: |
| 145 | source_file: Source .cpp file |
| 146 | output_object: Output .o file |
| 147 | |
| 148 | Returns: |
| 149 | True if compilation needed, False if up-to-date |
| 150 | """ |
| 151 | if not output_object.exists(): |
| 152 | return True |
| 153 | |
| 154 | source_mtime = source_file.stat().st_mtime |
| 155 | object_mtime = output_object.stat().st_mtime |
| 156 | |
| 157 | return source_mtime > object_mtime |
| 158 | |
| 159 | |
| 160 | def compile_object( |
no outgoing calls
no test coverage detected