()
| 334 | } |
| 335 | |
| 336 | func (b b2) msvcVersion() string { |
| 337 | toolchain := b.Ctx.Platform().GetToolchain() |
| 338 | |
| 339 | // Split by "." to get major, minor, patch |
| 340 | parts := strings.Split(toolchain.GetVersion(), ".") |
| 341 | if len(parts) < 2 { |
| 342 | panic(fmt.Errorf("invalid MSVC version format: %s", toolchain.GetVersion())) |
| 343 | } |
| 344 | |
| 345 | // Parse major and minor |
| 346 | major, err := strconv.Atoi(parts[0]) |
| 347 | if err != nil { |
| 348 | panic(fmt.Errorf("parse major version: %v", err)) |
| 349 | } |
| 350 | |
| 351 | minor, err := strconv.Atoi(parts[1]) |
| 352 | if err != nil { |
| 353 | panic(fmt.Errorf("parse minor version: %v", err)) |
| 354 | } |
| 355 | |
| 356 | if minor >= 10 { |
| 357 | minor = minor / 10 |
| 358 | } |
| 359 | return fmt.Sprintf("%d.%d", major, minor) |
| 360 | } |
| 361 | |
| 362 | // detectPlatformTriple dynamically detects the platform triple subdirectory |
| 363 | // in LLVM's include and lib directories. This avoids hardcoding platform-specific |
no test coverage detected