diff options
| author | Alexander Potapenko <glider@google.com> | 2020-05-14 11:57:49 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-05-15 14:08:01 +0200 |
| commit | 4da021feb0cab54d87d5b08c41bc3160132e5bb7 (patch) | |
| tree | d6165330a46e66867f61aad11b8850c45733190d | |
| parent | e2993cfc1312e039f8e36a42d264f7a2053f1b7c (diff) | |
targets.go: append flags in a more readable way
As suggested by Dmitry Vyukov
Signed-off-by: Alexander Potapenko <glider@google.com>
| -rw-r--r-- | sys/targets/targets.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/targets/targets.go b/sys/targets/targets.go index 548b114f0..1395b13ff 100644 --- a/sys/targets/targets.go +++ b/sys/targets/targets.go @@ -477,8 +477,9 @@ func initTarget(target *Target, OS, arch string) { target.CCompiler = fmt.Sprintf("cant-build-%v-on-%v", target.OS, runtime.GOOS) target.CPP = target.CCompiler } - target.CFlags = append(append([]string{}, target.osCommon.cflags...), target.CFlags...) - target.CFlags = append(append([]string{}, commonCFlags...), target.CFlags...) + for _, flags := range [][]string{commonCFlags, target.osCommon.cflags} { + target.CFlags = append(target.CFlags, flags...) + } } func (target *Target) lazyInit() { |
