(buildType string)
| 102 | } |
| 103 | |
| 104 | func (t Toolchain) effectiveFlags(buildType string) (cflags, cxxflags, linkflags []string) { |
| 105 | if strings.EqualFold(buildType, "debug") { |
| 106 | if len(t.CFlagsDebug) > 0 { |
| 107 | cflags = t.CFlagsDebug |
| 108 | } else { |
| 109 | cflags = t.CFlags |
| 110 | } |
| 111 | |
| 112 | if len(t.CXXFlagsDebug) > 0 { |
| 113 | cxxflags = t.CXXFlagsDebug |
| 114 | } else { |
| 115 | cxxflags = t.CXXFlags |
| 116 | } |
| 117 | |
| 118 | if len(t.LinkFlagsDebug) > 0 { |
| 119 | linkflags = t.LinkFlagsDebug |
| 120 | } else { |
| 121 | linkflags = t.LinkFlags |
| 122 | } |
| 123 | return cflags, cxxflags, linkflags |
| 124 | } |
| 125 | |
| 126 | return t.CFlags, t.CXXFlags, t.LinkFlags |
| 127 | } |
| 128 | |
| 129 | func (t Toolchain) generate(toolchain *strings.Builder) error { |
| 130 | writeIfNotEmpty := func(key, value string) { |
no outgoing calls