Get compiler information for a board. Args: board_name: Name of the board Returns: CompilerInfoResult with ok, compiler_info, and error fields
(self, board_name: str)
| 213 | return PlatformDefinesResult(ok=True, defines=defines, error="") |
| 214 | |
| 215 | def get_compiler_info(self, board_name: str) -> CompilerInfoResult: |
| 216 | """ |
| 217 | Get compiler information for a board. |
| 218 | |
| 219 | Args: |
| 220 | board_name: Name of the board |
| 221 | |
| 222 | Returns: |
| 223 | CompilerInfoResult with ok, compiler_info, and error fields |
| 224 | """ |
| 225 | data = self.load_build_info(board_name) |
| 226 | if not data: |
| 227 | return CompilerInfoResult( |
| 228 | ok=False, |
| 229 | compiler_info=CompilerInfo(), |
| 230 | error=f"Build info not found for {board_name}", |
| 231 | ) |
| 232 | |
| 233 | board_key = self.create_board_key_from_build_info(data, board_name) |
| 234 | if not board_key: |
| 235 | return CompilerInfoResult( |
| 236 | ok=False, |
| 237 | compiler_info=CompilerInfo(), |
| 238 | error="Board key not found in build_info.json", |
| 239 | ) |
| 240 | |
| 241 | board_data = data[board_key] |
| 242 | |
| 243 | compiler_info = CompilerInfo( |
| 244 | cc_path=board_data.get("cc_path", ""), |
| 245 | cxx_path=board_data.get("cxx_path", ""), |
| 246 | cc_flags=board_data.get("cc_flags", []), |
| 247 | cxx_flags=board_data.get("cxx_flags", []), |
| 248 | compiler_type=board_data.get("compiler_type", ""), |
| 249 | build_type=board_data.get("build_type", ""), |
| 250 | ) |
| 251 | |
| 252 | return CompilerInfoResult(ok=True, compiler_info=compiler_info, error="") |
| 253 | |
| 254 | def get_toolchain_aliases(self, board_name: str) -> ToolchainAliasesResult: |
| 255 | """ |
no test coverage detected