Detect IAR toolchain.
(self)
| 262 | return "iar" |
| 263 | |
| 264 | def detect(self) -> bool: |
| 265 | """Detect IAR toolchain.""" |
| 266 | iccarm_path = shutil.which("iccarm") |
| 267 | if not iccarm_path: |
| 268 | # Try common IAR installation paths |
| 269 | iar_paths = [ |
| 270 | r"C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\arm\bin", |
| 271 | r"C:\Program Files\IAR Systems\Embedded Workbench 8.0\arm\bin", |
| 272 | "/opt/iar/bin" |
| 273 | ] |
| 274 | for path in iar_paths: |
| 275 | test_path = os.path.join(path, "iccarm.exe" if os.name == 'nt' else "iccarm") |
| 276 | if os.path.exists(test_path): |
| 277 | iccarm_path = test_path |
| 278 | break |
| 279 | |
| 280 | if not iccarm_path: |
| 281 | return False |
| 282 | |
| 283 | self.info = ToolchainInfo( |
| 284 | name="iar", |
| 285 | version="8.x", # IAR version detection is complex |
| 286 | path=os.path.dirname(iccarm_path) |
| 287 | ) |
| 288 | return True |
| 289 | |
| 290 | def configure_environment(self, env) -> None: |
| 291 | """Configure environment for IAR.""" |
no test coverage detected