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

Method preConfigure

buildsystems/build_b2.go:43–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41}
42
43func (b *b2) preConfigure() error {
44 toolchain := b.Ctx.Platform().GetToolchain()
45
46 // `clang` inside visual studio cannot be used to compile b2 project.
47 if runtime.GOOS == "windows" && strings.Contains(toolchain.GetAbsDir(), "Microsoft Visual Studio") {
48 if toolchain.GetName() == "clang" {
49 return fmt.Errorf("visual studio's clang cannot be used to compile b2 project, msvc or clang-cl is required")
50 }
51 }
52
53 // For MSVC build, we need to set PATH, INCLUDE and LIB env vars.
54 if runtime.GOOS == "windows" {
55 if toolchain.GetName() == "msvc" || toolchain.GetName() == "clang-cl" {
56 msvcEnvs, err := b.readMSVCEnvs()
57 if err != nil {
58 return err
59 }
60
61 b.envBackup.setenv("PATH", msvcEnvs["PATH"])
62 b.envBackup.setenv("INCLUDE", msvcEnvs["INCLUDE"])
63 b.envBackup.setenv("LIB", msvcEnvs["LIB"])
64 }
65 }
66
67 return nil
68}
69
70func (b b2) configured() bool {
71 b2file := expr.If(runtime.GOOS == "windows", "b2.exe", "b2")

Callers

nothing calls this directly

Calls 6

readMSVCEnvsMethod · 0.80
setenvMethod · 0.80
GetToolchainMethod · 0.65
PlatformMethod · 0.65
GetAbsDirMethod · 0.65
GetNameMethod · 0.65

Tested by

no test coverage detected