MCPcopy Create free account
hub / github.com/celer-pkg/celer / msvcVersion

Method msvcVersion

buildsystems/build_b2.go:336–360  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

334}
335
336func (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

Callers 2

ConfigureMethod · 0.95
buildOptionsMethod · 0.95

Calls 4

SprintfMethod · 0.80
GetToolchainMethod · 0.65
PlatformMethod · 0.65
GetVersionMethod · 0.65

Tested by

no test coverage detected