MCPcopy
hub / github.com/syncthing/syncthing / appendParameters

Function appendParameters

build.go:519–545  ·  view source on GitHub ↗
(args []string, tags []string, pkgs ...string)

Source from the content-addressed store, hash-verified

517}
518
519func appendParameters(args []string, tags []string, pkgs ...string) []string {
520 if pkgdir != "" {
521 args = append(args, "-pkgdir", pkgdir)
522 }
523 if len(tags) > 0 {
524 args = append(args, "-tags", strings.Join(tags, " "))
525 }
526 if installSuffix != "" {
527 args = append(args, "-installsuffix", installSuffix)
528 }
529 if race {
530 args = append(args, "-race")
531 }
532
533 if !debugBinary {
534 // Regular binaries get version tagged and skip some debug symbols
535 args = append(args, "-trimpath", "-ldflags", ldflags(tags))
536 } else {
537 // -gcflags to disable optimizations and inlining. Skip -ldflags
538 // because `Could not launch program: decoding dwarf section info at
539 // offset 0x0: too short` on 'dlv exec ...' see
540 // https://github.com/go-delve/delve/issues/79
541 args = append(args, "-gcflags", "all=-N -l")
542 }
543
544 return append(args, pkgs...)
545}
546
547func buildTar(target target, tags []string) {
548 name := archiveName(target)

Callers 2

installFunction · 0.85
buildFunction · 0.85

Calls 1

ldflagsFunction · 0.85

Tested by

no test coverage detected