Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 1 | // Copyright 2016 Google Inc. All rights reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package cc |
| 16 | |
| 17 | import ( |
| 18 | "fmt" |
| 19 | "path/filepath" |
| 20 | "strings" |
| 21 | |
Colin Cross | 635c3b0 | 2016-05-18 15:37:25 -0700 | [diff] [blame] | 22 | "android/soong/android" |
Colin Cross | b98c8b0 | 2016-07-29 13:44:28 -0700 | [diff] [blame^] | 23 | "android/soong/cc/config" |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 24 | ) |
| 25 | |
| 26 | func init() { |
Colin Cross | 635c3b0 | 2016-05-18 15:37:25 -0700 | [diff] [blame] | 27 | android.RegisterMakeVarsProvider(pctx, makeVarsProvider) |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 28 | } |
| 29 | |
Colin Cross | 635c3b0 | 2016-05-18 15:37:25 -0700 | [diff] [blame] | 30 | func makeVarsProvider(ctx android.MakeVarsContext) { |
Colin Cross | b98c8b0 | 2016-07-29 13:44:28 -0700 | [diff] [blame^] | 31 | ctx.Strict("LLVM_PREBUILTS_VERSION", "${config.ClangVersion}") |
| 32 | ctx.Strict("LLVM_PREBUILTS_BASE", "${config.ClangBase}") |
| 33 | ctx.Strict("LLVM_PREBUILTS_PATH", "${config.ClangBin}") |
| 34 | ctx.Strict("CLANG", "${config.ClangBin}/clang") |
| 35 | ctx.Strict("CLANG_CXX", "${config.ClangBin}/clang++") |
| 36 | ctx.Strict("LLVM_AS", "${config.ClangBin}/llvm-as") |
| 37 | ctx.Strict("LLVM_LINK", "${config.ClangBin}/llvm-link") |
| 38 | ctx.StrictSorted("CLANG_CONFIG_UNKNOWN_CFLAGS", strings.Join(config.ClangUnknownCflags, " ")) |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 39 | |
Colin Cross | b98c8b0 | 2016-07-29 13:44:28 -0700 | [diff] [blame^] | 40 | ctx.Strict("GLOBAL_CFLAGS_NO_OVERRIDE", "${config.NoOverrideGlobalCflags}") |
| 41 | ctx.Strict("GLOBAL_CLANG_CFLAGS_NO_OVERRIDE", "${config.ClangExtraNoOverrideCflags}") |
Dan Willemsen | 5efc706 | 2016-05-27 15:23:38 -0700 | [diff] [blame] | 42 | ctx.Strict("GLOBAL_CPPFLAGS_NO_OVERRIDE", "") |
| 43 | ctx.Strict("GLOBAL_CLANG_CPPFLAGS_NO_OVERRIDE", "") |
Dan Willemsen | 97704ed | 2016-07-07 21:40:39 -0700 | [diff] [blame] | 44 | ctx.Strict("NDK_PREBUILT_SHARED_LIBRARIES", strings.Join(ndkPrebuiltSharedLibs, " ")) |
Dan Willemsen | 5efc706 | 2016-05-27 15:23:38 -0700 | [diff] [blame] | 45 | |
Colin Cross | b98c8b0 | 2016-07-29 13:44:28 -0700 | [diff] [blame^] | 46 | includeFlags, err := ctx.Eval("${config.CommonGlobalIncludes}") |
Colin Cross | 10c78c6 | 2016-07-20 12:14:19 -0700 | [diff] [blame] | 47 | if err != nil { |
| 48 | panic(err) |
| 49 | } |
| 50 | includes, systemIncludes := splitSystemIncludes(ctx, includeFlags) |
| 51 | ctx.StrictRaw("SRC_HEADERS", strings.Join(includes, " ")) |
| 52 | ctx.StrictRaw("SRC_SYSTEM_HEADERS", strings.Join(systemIncludes, " ")) |
| 53 | |
Dan Albert | 914449f | 2016-06-17 16:45:24 -0700 | [diff] [blame] | 54 | ctx.Strict("NDK_MIGRATED_LIBS", strings.Join(ndkMigratedLibs, " ")) |
| 55 | |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 56 | hostTargets := ctx.Config().Targets[android.Host] |
| 57 | makeVarsToolchain(ctx, "", hostTargets[0]) |
| 58 | if len(hostTargets) > 1 { |
| 59 | makeVarsToolchain(ctx, "2ND_", hostTargets[1]) |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 60 | } |
| 61 | |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 62 | crossTargets := ctx.Config().Targets[android.HostCross] |
| 63 | if len(crossTargets) > 0 { |
| 64 | makeVarsToolchain(ctx, "", crossTargets[0]) |
| 65 | if len(crossTargets) > 1 { |
| 66 | makeVarsToolchain(ctx, "2ND_", crossTargets[1]) |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 67 | } |
| 68 | } |
| 69 | |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 70 | deviceTargets := ctx.Config().Targets[android.Device] |
| 71 | makeVarsToolchain(ctx, "", deviceTargets[0]) |
| 72 | if len(deviceTargets) > 1 { |
| 73 | makeVarsToolchain(ctx, "2ND_", deviceTargets[1]) |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 74 | } |
| 75 | } |
| 76 | |
Colin Cross | 635c3b0 | 2016-05-18 15:37:25 -0700 | [diff] [blame] | 77 | func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string, |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 78 | target android.Target) { |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 79 | var typePrefix string |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 80 | switch target.Os.Class { |
| 81 | case android.Host: |
| 82 | typePrefix = "HOST_" |
| 83 | case android.HostCross: |
| 84 | typePrefix = "HOST_CROSS_" |
| 85 | case android.Device: |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 86 | typePrefix = "TARGET_" |
| 87 | } |
| 88 | makePrefix := secondPrefix + typePrefix |
| 89 | |
Colin Cross | b98c8b0 | 2016-07-29 13:44:28 -0700 | [diff] [blame^] | 90 | toolchain := config.FindToolchain(target.Os, target.Arch) |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 91 | |
Dan Willemsen | 36cff8b | 2016-05-17 16:35:02 -0700 | [diff] [blame] | 92 | var productExtraCflags string |
| 93 | var productExtraLdflags string |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 94 | |
Colin Cross | b98c8b0 | 2016-07-29 13:44:28 -0700 | [diff] [blame^] | 95 | hod := "Host" |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 96 | if target.Os.Class == android.Device { |
Colin Cross | b98c8b0 | 2016-07-29 13:44:28 -0700 | [diff] [blame^] | 97 | hod = "Device" |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | if target.Os.Class == android.Device && Bool(ctx.Config().ProductVariables.Brillo) { |
Dan Willemsen | 36cff8b | 2016-05-17 16:35:02 -0700 | [diff] [blame] | 101 | productExtraCflags += "-D__BRILLO__" |
| 102 | } |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 103 | if target.Os.Class == android.Host && Bool(ctx.Config().ProductVariables.HostStaticBinaries) { |
Dan Willemsen | 36cff8b | 2016-05-17 16:35:02 -0700 | [diff] [blame] | 104 | productExtraLdflags += "-static" |
Dan Willemsen | 06f4533 | 2016-05-16 19:32:33 -0700 | [diff] [blame] | 105 | } |
| 106 | |
Dan Willemsen | 9598e10 | 2016-05-19 16:59:04 -0700 | [diff] [blame] | 107 | ctx.Strict(makePrefix+"GLOBAL_CFLAGS", strings.Join([]string{ |
Dan Willemsen | d26a713 | 2016-05-18 23:00:57 -0700 | [diff] [blame] | 108 | toolchain.Cflags(), |
Colin Cross | b98c8b0 | 2016-07-29 13:44:28 -0700 | [diff] [blame^] | 109 | "${config.CommonGlobalCflags}", |
| 110 | fmt.Sprintf("${config.%sGlobalCflags}", hod), |
Dan Willemsen | d26a713 | 2016-05-18 23:00:57 -0700 | [diff] [blame] | 111 | toolchain.ToolchainCflags(), |
Dan Willemsen | 36cff8b | 2016-05-17 16:35:02 -0700 | [diff] [blame] | 112 | productExtraCflags, |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 113 | }, " ")) |
Dan Willemsen | 9598e10 | 2016-05-19 16:59:04 -0700 | [diff] [blame] | 114 | ctx.Strict(makePrefix+"GLOBAL_CONLYFLAGS", "") |
| 115 | ctx.Strict(makePrefix+"GLOBAL_CPPFLAGS", strings.Join([]string{ |
Colin Cross | b98c8b0 | 2016-07-29 13:44:28 -0700 | [diff] [blame^] | 116 | "${config.CommonGlobalCppflags}", |
Dan Willemsen | 216a459 | 2016-05-16 23:56:53 -0700 | [diff] [blame] | 117 | toolchain.Cppflags(), |
| 118 | }, " ")) |
Dan Willemsen | 9598e10 | 2016-05-19 16:59:04 -0700 | [diff] [blame] | 119 | ctx.Strict(makePrefix+"GLOBAL_LDFLAGS", strings.Join([]string{ |
Dan Willemsen | d26a713 | 2016-05-18 23:00:57 -0700 | [diff] [blame] | 120 | toolchain.Ldflags(), |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 121 | toolchain.ToolchainLdflags(), |
Dan Willemsen | 36cff8b | 2016-05-17 16:35:02 -0700 | [diff] [blame] | 122 | productExtraLdflags, |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 123 | }, " ")) |
Dan Willemsen | 558e517 | 2016-05-19 16:58:46 -0700 | [diff] [blame] | 124 | |
| 125 | includeFlags, err := ctx.Eval(toolchain.IncludeFlags()) |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 126 | if err != nil { |
| 127 | panic(err) |
| 128 | } |
Colin Cross | 10c78c6 | 2016-07-20 12:14:19 -0700 | [diff] [blame] | 129 | includes, systemIncludes := splitSystemIncludes(ctx, includeFlags) |
| 130 | ctx.StrictRaw(makePrefix+"C_INCLUDES", strings.Join(includes, " ")) |
| 131 | ctx.StrictRaw(makePrefix+"C_SYSTEM_INCLUDES", strings.Join(systemIncludes, " ")) |
Dan Willemsen | 558e517 | 2016-05-19 16:58:46 -0700 | [diff] [blame] | 132 | |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 133 | if target.Arch.ArchType == android.Arm { |
Dan Willemsen | 558e517 | 2016-05-19 16:58:46 -0700 | [diff] [blame] | 134 | flags, err := toolchain.InstructionSetFlags("arm") |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 135 | if err != nil { |
| 136 | panic(err) |
| 137 | } |
Dan Willemsen | 558e517 | 2016-05-19 16:58:46 -0700 | [diff] [blame] | 138 | ctx.Strict(makePrefix+"arm_CFLAGS", flags) |
| 139 | |
| 140 | flags, err = toolchain.InstructionSetFlags("thumb") |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 141 | if err != nil { |
| 142 | panic(err) |
| 143 | } |
Dan Willemsen | 558e517 | 2016-05-19 16:58:46 -0700 | [diff] [blame] | 144 | ctx.Strict(makePrefix+"thumb_CFLAGS", flags) |
| 145 | } |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 146 | |
| 147 | if toolchain.ClangSupported() { |
| 148 | clangPrefix := secondPrefix + "CLANG_" + typePrefix |
Dan Willemsen | 3772da1 | 2016-05-16 18:01:46 -0700 | [diff] [blame] | 149 | clangExtras := "-target " + toolchain.ClangTriple() |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 150 | if target.Os != android.Darwin { |
Dan Willemsen | 3772da1 | 2016-05-16 18:01:46 -0700 | [diff] [blame] | 151 | clangExtras += " -B" + filepath.Join(toolchain.GccRoot(), toolchain.GccTriple(), "bin") |
| 152 | } |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 153 | |
Dan Willemsen | 9598e10 | 2016-05-19 16:59:04 -0700 | [diff] [blame] | 154 | ctx.Strict(clangPrefix+"GLOBAL_CFLAGS", strings.Join([]string{ |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 155 | toolchain.ClangCflags(), |
Colin Cross | b98c8b0 | 2016-07-29 13:44:28 -0700 | [diff] [blame^] | 156 | "${config.CommonClangGlobalCflags}", |
| 157 | fmt.Sprintf("${config.%sClangGlobalCflags}", hod), |
Dan Willemsen | d26a713 | 2016-05-18 23:00:57 -0700 | [diff] [blame] | 158 | toolchain.ToolchainClangCflags(), |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 159 | clangExtras, |
Dan Willemsen | d26a713 | 2016-05-18 23:00:57 -0700 | [diff] [blame] | 160 | productExtraCflags, |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 161 | }, " ")) |
Colin Cross | b98c8b0 | 2016-07-29 13:44:28 -0700 | [diff] [blame^] | 162 | ctx.Strict(clangPrefix+"GLOBAL_CONLYFLAGS", "${config.ClangExtraConlyflags}") |
Dan Willemsen | 9598e10 | 2016-05-19 16:59:04 -0700 | [diff] [blame] | 163 | ctx.Strict(clangPrefix+"GLOBAL_CPPFLAGS", strings.Join([]string{ |
Colin Cross | b98c8b0 | 2016-07-29 13:44:28 -0700 | [diff] [blame^] | 164 | "${config.CommonClangGlobalCppflags}", |
Dan Willemsen | 216a459 | 2016-05-16 23:56:53 -0700 | [diff] [blame] | 165 | toolchain.ClangCppflags(), |
| 166 | }, " ")) |
Dan Willemsen | 9598e10 | 2016-05-19 16:59:04 -0700 | [diff] [blame] | 167 | ctx.Strict(clangPrefix+"GLOBAL_LDFLAGS", strings.Join([]string{ |
Dan Willemsen | d26a713 | 2016-05-18 23:00:57 -0700 | [diff] [blame] | 168 | toolchain.ClangLdflags(), |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 169 | toolchain.ToolchainClangLdflags(), |
Dan Willemsen | 36cff8b | 2016-05-17 16:35:02 -0700 | [diff] [blame] | 170 | productExtraLdflags, |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 171 | clangExtras, |
| 172 | }, " ")) |
Dan Willemsen | 558e517 | 2016-05-19 16:58:46 -0700 | [diff] [blame] | 173 | |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 174 | if target.Os.Class == android.Device { |
| 175 | ctx.Strict(secondPrefix+"ADDRESS_SANITIZER_RUNTIME_LIBRARY", strings.TrimSuffix(toolchain.AddressSanitizerRuntimeLibrary(), ".so")) |
Dan Willemsen | 558e517 | 2016-05-19 16:58:46 -0700 | [diff] [blame] | 176 | } |
| 177 | |
| 178 | // This is used by external/gentoo/... |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 179 | ctx.Strict("CLANG_CONFIG_"+target.Arch.ArchType.Name+"_"+typePrefix+"TRIPLE", |
Dan Willemsen | 558e517 | 2016-05-19 16:58:46 -0700 | [diff] [blame] | 180 | toolchain.ClangTriple()) |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 181 | } |
| 182 | |
| 183 | ctx.Strict(makePrefix+"CC", gccCmd(toolchain, "gcc")) |
| 184 | ctx.Strict(makePrefix+"CXX", gccCmd(toolchain, "g++")) |
| 185 | |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 186 | if target.Os == android.Darwin { |
Colin Cross | b98c8b0 | 2016-07-29 13:44:28 -0700 | [diff] [blame^] | 187 | ctx.Strict(makePrefix+"AR", "${config.MacArPath}") |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 188 | } else { |
| 189 | ctx.Strict(makePrefix+"AR", gccCmd(toolchain, "ar")) |
| 190 | ctx.Strict(makePrefix+"READELF", gccCmd(toolchain, "readelf")) |
| 191 | ctx.Strict(makePrefix+"NM", gccCmd(toolchain, "nm")) |
| 192 | } |
Dan Willemsen | 73d21f2 | 2016-05-16 14:22:56 -0700 | [diff] [blame] | 193 | |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 194 | if target.Os == android.Windows { |
Dan Willemsen | 73d21f2 | 2016-05-16 14:22:56 -0700 | [diff] [blame] | 195 | ctx.Strict(makePrefix+"OBJDUMP", gccCmd(toolchain, "objdump")) |
| 196 | } |
| 197 | |
Colin Cross | a1ad8d1 | 2016-06-01 17:09:44 -0700 | [diff] [blame] | 198 | if target.Os.Class == android.Device { |
Dan Willemsen | 73d21f2 | 2016-05-16 14:22:56 -0700 | [diff] [blame] | 199 | ctx.Strict(makePrefix+"OBJCOPY", gccCmd(toolchain, "objcopy")) |
| 200 | ctx.Strict(makePrefix+"LD", gccCmd(toolchain, "ld")) |
| 201 | ctx.Strict(makePrefix+"STRIP", gccCmd(toolchain, "strip")) |
Dan Willemsen | 558e517 | 2016-05-19 16:58:46 -0700 | [diff] [blame] | 202 | ctx.Strict(makePrefix+"GCC_VERSION", toolchain.GccVersion()) |
| 203 | ctx.Strict(makePrefix+"NDK_GCC_VERSION", toolchain.GccVersion()) |
Dan Albert | 914449f | 2016-06-17 16:45:24 -0700 | [diff] [blame] | 204 | ctx.Strict(makePrefix+"NDK_TRIPLE", toolchain.ClangTriple()) |
Dan Willemsen | 73d21f2 | 2016-05-16 14:22:56 -0700 | [diff] [blame] | 205 | } |
| 206 | |
Dan Willemsen | 0bd5887 | 2016-05-26 15:23:07 -0700 | [diff] [blame] | 207 | ctx.Strict(makePrefix+"TOOLCHAIN_ROOT", toolchain.GccRoot()) |
Dan Willemsen | 73d21f2 | 2016-05-16 14:22:56 -0700 | [diff] [blame] | 208 | ctx.Strict(makePrefix+"TOOLS_PREFIX", gccCmd(toolchain, "")) |
Dan Willemsen | 558e517 | 2016-05-19 16:58:46 -0700 | [diff] [blame] | 209 | ctx.Strict(makePrefix+"SHLIB_SUFFIX", toolchain.ShlibSuffix()) |
| 210 | ctx.Strict(makePrefix+"EXECUTABLE_SUFFIX", toolchain.ExecutableSuffix()) |
Dan Willemsen | 4b7d5de | 2016-01-12 23:20:28 -0800 | [diff] [blame] | 211 | } |
Colin Cross | 10c78c6 | 2016-07-20 12:14:19 -0700 | [diff] [blame] | 212 | |
| 213 | func splitSystemIncludes(ctx android.MakeVarsContext, val string) (includes, systemIncludes []string) { |
| 214 | flags, err := ctx.Eval(val) |
| 215 | if err != nil { |
| 216 | panic(err) |
| 217 | } |
| 218 | |
| 219 | extract := func(flags string, dirs []string, prefix string) (string, []string, bool) { |
| 220 | if strings.HasPrefix(flags, prefix) { |
| 221 | flags = strings.TrimPrefix(flags, prefix) |
| 222 | flags = strings.TrimLeft(flags, " ") |
| 223 | s := strings.SplitN(flags, " ", 2) |
| 224 | dirs = append(dirs, s[0]) |
| 225 | if len(s) > 1 { |
| 226 | return strings.TrimLeft(s[1], " "), dirs, true |
| 227 | } |
| 228 | return "", dirs, true |
| 229 | } else { |
| 230 | return flags, dirs, false |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | flags = strings.TrimLeft(flags, " ") |
| 235 | for flags != "" { |
| 236 | found := false |
| 237 | flags, includes, found = extract(flags, includes, "-I") |
| 238 | if !found { |
| 239 | flags, systemIncludes, found = extract(flags, systemIncludes, "-isystem ") |
| 240 | } |
| 241 | if !found { |
| 242 | panic(fmt.Errorf("Unexpected flag in %q", flags)) |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | return includes, systemIncludes |
| 247 | } |