Detect GCC toolchain.
(self)
| 73 | return "gcc" |
| 74 | |
| 75 | def detect(self) -> bool: |
| 76 | """Detect GCC toolchain.""" |
| 77 | gcc_path = shutil.which(self.prefix + "gcc") |
| 78 | if not gcc_path: |
| 79 | return False |
| 80 | |
| 81 | # Get version |
| 82 | ret, stdout, _ = self._run_command([gcc_path, "--version"]) |
| 83 | if ret == 0: |
| 84 | lines = stdout.split('\n') |
| 85 | if lines: |
| 86 | version = lines[0].split()[-1] |
| 87 | self.info = ToolchainInfo( |
| 88 | name="gcc", |
| 89 | version=version, |
| 90 | path=os.path.dirname(gcc_path), |
| 91 | prefix=self.prefix |
| 92 | ) |
| 93 | return True |
| 94 | |
| 95 | return False |
| 96 | |
| 97 | def configure_environment(self, env) -> None: |
| 98 | """Configure environment for GCC.""" |
nothing calls this directly
no test coverage detected