(options []string)
| 58 | } |
| 59 | |
| 60 | func (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 | |
| 92 | func (c custom) Build(options []string) error { |
| 93 | toolchain := c.Ctx.Platform().GetToolchain() |
nothing calls this directly
no test coverage detected