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

Method Validate

buildsystems/buildconfig.go:283–311  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

281}
282
283func (b BuildConfig) Validate() error {
284 // Validate buildsystem.
285 name, _, hasVersion, err := b.parseBuildSystem(b.BuildSystem)
286 if err != nil {
287 return err
288 }
289
290 // Check unsupported buildsystem.
291 if !slices.Contains(buildSystems, name) {
292 return fmt.Errorf("unsupported build system for %s, it should be one of %s", b.BuildSystem, strings.Join(buildSystems, ", "))
293 }
294
295 // Validate versioned build system.
296 if hasVersion && name != "cmake" && name != "meson" && name != "gyp" {
297 return fmt.Errorf("build_system %q does not support version suffix, only cmake, meson and gyp support versions", b.BuildSystem)
298 }
299
300 // Validate c_standard.
301 if strings.TrimSpace(b.CStandard) != "" && !slices.Contains(CStandards, b.CStandard) {
302 return fmt.Errorf("c_standard should be one of %s", strings.Join(CStandards, ", "))
303 }
304
305 // Validate cxx_standard.
306 if strings.TrimSpace(b.CXXStandard) != "" && !slices.Contains(CXXStandards, b.CXXStandard) {
307 return fmt.Errorf("cxx_standard should be one of %s", strings.Join(CXXStandards, ", "))
308 }
309
310 return nil
311}
312
313func (b BuildConfig) Clone(repoUrl, repoRef, archive string, depth int) error {
314 if fileio.PathExists(b.PortConfig.RepoDir) {

Callers

nothing calls this directly

Calls 1

parseBuildSystemMethod · 0.95

Tested by

no test coverage detected