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

Method Configure

buildsystems/build_custom.go:60–90  ·  view source on GitHub ↗
(options []string)

Source from the content-addressed store, hash-verified

58}
59
60func (c custom) Configure(options []string) error {
61 toolchain := c.Ctx.Platform().GetToolchain()
62 rootfs := c.Ctx.Platform().GetRootFS()
63
64 if len(c.CustomConfigure) > 0 {
65 // msvc and clang-cl need to set build environment event in dev mode.
66 if (c.DevDep || c.HostDev) && toolchain.GetName() != "msvc" && toolchain.GetName() != "clang-cl" {
67 toolchain.ClearEnvs()
68 } else {
69 toolchain.SetEnvs(rootfs, c.Name(), c.Envs)
70 }
71
72 // Create build dir if not exists.
73 if !c.BuildInSource {
74 if err := os.MkdirAll(c.PortConfig.BuildDir, os.ModePerm); err != nil {
75 return err
76 }
77 }
78
79 scripts := strings.Join(c.CustomConfigure, " && ")
80 scripts = c.expandVariables(scripts)
81 title := fmt.Sprintf("[configure %s]", c.PortConfig.nameVersion())
82 executor := cmd.NewExecutor(title, scripts)
83 executor.SetLogPath(c.getLogPath("configure"))
84 executor.SetWorkDir(expr.If(c.BuildInSource, c.PortConfig.SrcDir, c.PortConfig.BuildDir))
85 if err := executor.Execute(); err != nil {
86 return err
87 }
88 }
89 return nil
90}
91
92func (c custom) Build(options []string) error {
93 toolchain := c.Ctx.Platform().GetToolchain()

Callers

nothing calls this directly

Calls 15

NameMethod · 0.95
NewExecutorFunction · 0.92
IfFunction · 0.92
MkdirAllMethod · 0.80
expandVariablesMethod · 0.80
SprintfMethod · 0.80
nameVersionMethod · 0.80
SetLogPathMethod · 0.80
SetWorkDirMethod · 0.80
ExecuteMethod · 0.80
GetToolchainMethod · 0.65
PlatformMethod · 0.65

Tested by

no test coverage detected