1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef TOOLS_GN_VARIABLES_H_ 6 #define TOOLS_GN_VARIABLES_H_ 7 8 #include <map> 9 #include <string_view> 10 11 namespace variables { 12 13 // Builtin vars ---------------------------------------------------------------- 14 15 extern const char kHostCpu[]; 16 extern const char kHostCpu_HelpShort[]; 17 extern const char kHostCpu_Help[]; 18 19 extern const char kHostOs[]; 20 extern const char kHostOs_HelpShort[]; 21 extern const char kHostOs_Help[]; 22 23 extern const char kCurrentCpu[]; 24 extern const char kCurrentCpu_HelpShort[]; 25 extern const char kCurrentCpu_Help[]; 26 27 extern const char kCurrentOs[]; 28 extern const char kCurrentOs_HelpShort[]; 29 extern const char kCurrentOs_Help[]; 30 31 extern const char kCurrentToolchain[]; 32 extern const char kCurrentToolchain_HelpShort[]; 33 extern const char kCurrentToolchain_Help[]; 34 35 extern const char kDefaultToolchain[]; 36 extern const char kDefaultToolchain_HelpShort[]; 37 extern const char kDefaultToolchain_Help[]; 38 39 extern const char kGnVersion[]; 40 extern const char kGnVersion_HelpShort[]; 41 extern const char kGnVersion_Help[]; 42 43 extern const char kInvoker[]; 44 extern const char kInvoker_HelpShort[]; 45 extern const char kInvoker_Help[]; 46 47 extern const char kPythonPath[]; 48 extern const char kPythonPath_HelpShort[]; 49 extern const char kPythonPath_Help[]; 50 51 extern const char kRootBuildDir[]; 52 extern const char kRootBuildDir_HelpShort[]; 53 extern const char kRootBuildDir_Help[]; 54 55 extern const char kRootGenDir[]; 56 extern const char kRootGenDir_HelpShort[]; 57 extern const char kRootGenDir_Help[]; 58 59 extern const char kRootOutDir[]; 60 extern const char kRootOutDir_HelpShort[]; 61 extern const char kRootOutDir_Help[]; 62 63 extern const char kTargetCpu[]; 64 extern const char kTargetCpu_HelpShort[]; 65 extern const char kTargetCpu_Help[]; 66 67 extern const char kTargetName[]; 68 extern const char kTargetName_HelpShort[]; 69 extern const char kTargetName_Help[]; 70 71 extern const char kTargetOs[]; 72 extern const char kTargetOs_HelpShort[]; 73 extern const char kTargetOs_Help[]; 74 75 extern const char kTargetGenDir[]; 76 extern const char kTargetGenDir_HelpShort[]; 77 extern const char kTargetGenDir_Help[]; 78 79 extern const char kTargetOutDir[]; 80 extern const char kTargetOutDir_HelpShort[]; 81 extern const char kTargetOutDir_Help[]; 82 83 // Target vars ----------------------------------------------------------------- 84 85 extern const char kAllDependentConfigs[]; 86 extern const char kAllDependentConfigs_HelpShort[]; 87 extern const char kAllDependentConfigs_Help[]; 88 89 extern const char kAllowCircularIncludesFrom[]; 90 extern const char kAllowCircularIncludesFrom_HelpShort[]; 91 extern const char kAllowCircularIncludesFrom_Help[]; 92 93 extern const char kArflags[]; 94 extern const char kArflags_HelpShort[]; 95 extern const char kArflags_Help[]; 96 97 extern const char kArgs[]; 98 extern const char kArgs_HelpShort[]; 99 extern const char kArgs_Help[]; 100 101 extern const char kAsmflags[]; 102 extern const char kAsmflags_HelpShort[]; 103 extern const char* kAsmflags_Help; 104 105 extern const char kAssertNoDeps[]; 106 extern const char kAssertNoDeps_HelpShort[]; 107 extern const char kAssertNoDeps_Help[]; 108 109 extern const char kBundleRootDir[]; 110 extern const char kBundleRootDir_HelpShort[]; 111 extern const char kBundleRootDir_Help[]; 112 113 extern const char kBundleContentsDir[]; 114 extern const char kBundleContentsDir_HelpShort[]; 115 extern const char kBundleContentsDir_Help[]; 116 117 extern const char kBundleResourcesDir[]; 118 extern const char kBundleResourcesDir_HelpShort[]; 119 extern const char kBundleResourcesDir_Help[]; 120 121 extern const char kBundleDepsFilter[]; 122 extern const char kBundleDepsFilter_HelpShort[]; 123 extern const char kBundleDepsFilter_Help[]; 124 125 extern const char kBundleExecutableDir[]; 126 extern const char kBundleExecutableDir_HelpShort[]; 127 extern const char kBundleExecutableDir_Help[]; 128 129 extern const char kXcassetCompilerFlags[]; 130 extern const char kXcassetCompilerFlags_HelpShort[]; 131 extern const char kXcassetCompilerFlags_Help[]; 132 133 extern const char kCflags[]; 134 extern const char kCflags_HelpShort[]; 135 extern const char* kCflags_Help; 136 137 extern const char kCflagsC[]; 138 extern const char kCflagsC_HelpShort[]; 139 extern const char* kCflagsC_Help; 140 141 extern const char kCflagsCC[]; 142 extern const char kCflagsCC_HelpShort[]; 143 extern const char* kCflagsCC_Help; 144 145 extern const char kCflagsObjC[]; 146 extern const char kCflagsObjC_HelpShort[]; 147 extern const char* kCflagsObjC_Help; 148 149 extern const char kCflagsObjCC[]; 150 extern const char kCflagsObjCC_HelpShort[]; 151 extern const char* kCflagsObjCC_Help; 152 153 extern const char kCheckIncludes[]; 154 extern const char kCheckIncludes_HelpShort[]; 155 extern const char kCheckIncludes_Help[]; 156 157 extern const char kCodeSigningArgs[]; 158 extern const char kCodeSigningArgs_HelpShort[]; 159 extern const char kCodeSigningArgs_Help[]; 160 161 extern const char kCodeSigningScript[]; 162 extern const char kCodeSigningScript_HelpShort[]; 163 extern const char kCodeSigningScript_Help[]; 164 165 extern const char kCodeSigningSources[]; 166 extern const char kCodeSigningSources_HelpShort[]; 167 extern const char kCodeSigningSources_Help[]; 168 169 extern const char kCodeSigningOutputs[]; 170 extern const char kCodeSigningOutputs_HelpShort[]; 171 extern const char kCodeSigningOutputs_Help[]; 172 173 extern const char kCompleteStaticLib[]; 174 extern const char kCompleteStaticLib_HelpShort[]; 175 extern const char kCompleteStaticLib_Help[]; 176 177 extern const char kConfigs[]; 178 extern const char kConfigs_HelpShort[]; 179 extern const char kConfigs_Help[]; 180 181 extern const char kData[]; 182 extern const char kData_HelpShort[]; 183 extern const char kData_Help[]; 184 185 extern const char kDataDeps[]; 186 extern const char kDataDeps_HelpShort[]; 187 extern const char kDataDeps_Help[]; 188 189 extern const char kDataKeys[]; 190 extern const char kDataKeys_HelpShort[]; 191 extern const char kDataKeys_Help[]; 192 193 extern const char kDefines[]; 194 extern const char kDefines_HelpShort[]; 195 extern const char kDefines_Help[]; 196 197 extern const char kDepfile[]; 198 extern const char kDepfile_HelpShort[]; 199 extern const char kDepfile_Help[]; 200 201 extern const char kDeps[]; 202 extern const char kDeps_HelpShort[]; 203 extern const char kDeps_Help[]; 204 205 extern const char kExterns[]; 206 extern const char kExterns_HelpShort[]; 207 extern const char kExterns_Help[]; 208 209 extern const char kFriend[]; 210 extern const char kFriend_HelpShort[]; 211 extern const char kFriend_Help[]; 212 213 extern const char kFrameworkDirs[]; 214 extern const char kFrameworkDirs_HelpShort[]; 215 extern const char kFrameworkDirs_Help[]; 216 217 extern const char kFrameworks[]; 218 extern const char kFrameworks_HelpShort[]; 219 extern const char kFrameworks_Help[]; 220 221 extern const char kIncludeDirs[]; 222 extern const char kIncludeDirs_HelpShort[]; 223 extern const char kIncludeDirs_Help[]; 224 225 extern const char kInputs[]; 226 extern const char kInputs_HelpShort[]; 227 extern const char kInputs_Help[]; 228 229 extern const char kLdflags[]; 230 extern const char kLdflags_HelpShort[]; 231 extern const char kLdflags_Help[]; 232 233 extern const char kLibDirs[]; 234 extern const char kLibDirs_HelpShort[]; 235 extern const char kLibDirs_Help[]; 236 237 extern const char kLibs[]; 238 extern const char kLibs_HelpShort[]; 239 extern const char kLibs_Help[]; 240 241 extern const char kMetadata[]; 242 extern const char kMetadata_HelpShort[]; 243 extern const char kMetadata_Help[]; 244 245 extern const char kOutputDir[]; 246 extern const char kOutputDir_HelpShort[]; 247 extern const char kOutputDir_Help[]; 248 249 extern const char kOutputExtension[]; 250 extern const char kOutputExtension_HelpShort[]; 251 extern const char kOutputExtension_Help[]; 252 253 extern const char kOutputName[]; 254 extern const char kOutputName_HelpShort[]; 255 extern const char kOutputName_Help[]; 256 257 extern const char kOutputPrefixOverride[]; 258 extern const char kOutputPrefixOverride_HelpShort[]; 259 extern const char kOutputPrefixOverride_Help[]; 260 261 extern const char kOutputs[]; 262 extern const char kOutputs_HelpShort[]; 263 extern const char kOutputs_Help[]; 264 265 extern const char kPartialInfoPlist[]; 266 extern const char kPartialInfoPlist_HelpShort[]; 267 extern const char kPartialInfoPlist_Help[]; 268 269 extern const char kPool[]; 270 extern const char kPool_HelpShort[]; 271 extern const char kPool_Help[]; 272 273 extern const char kPrecompiledHeader[]; 274 extern const char kPrecompiledHeader_HelpShort[]; 275 extern const char kPrecompiledHeader_Help[]; 276 277 extern const char kPrecompiledHeaderType[]; 278 extern const char kPrecompiledHeaderType_HelpShort[]; 279 extern const char kPrecompiledHeaderType_Help[]; 280 281 extern const char kPrecompiledSource[]; 282 extern const char kPrecompiledSource_HelpShort[]; 283 extern const char kPrecompiledSource_Help[]; 284 285 extern const char kProductType[]; 286 extern const char kProductType_HelpShort[]; 287 extern const char kProductType_Help[]; 288 289 extern const char kPublic[]; 290 extern const char kPublic_HelpShort[]; 291 extern const char kPublic_Help[]; 292 293 extern const char kPublicConfigs[]; 294 extern const char kPublicConfigs_HelpShort[]; 295 extern const char kPublicConfigs_Help[]; 296 297 extern const char kPublicDeps[]; 298 extern const char kPublicDeps_HelpShort[]; 299 extern const char kPublicDeps_Help[]; 300 301 extern const char kRebase[]; 302 extern const char kRebase_HelpShort[]; 303 extern const char kRebase_Help[]; 304 305 extern const char kResponseFileContents[]; 306 extern const char kResponseFileContents_HelpShort[]; 307 extern const char kResponseFileContents_Help[]; 308 309 extern const char kScript[]; 310 extern const char kScript_HelpShort[]; 311 extern const char kScript_Help[]; 312 313 extern const char kSources[]; 314 extern const char kSources_HelpShort[]; 315 extern const char kSources_Help[]; 316 317 extern const char kSwiftflags[]; 318 extern const char kSwiftflags_HelpShort[]; 319 extern const char* kSwiftflags_Help; 320 321 extern const char kXcodeTestApplicationName[]; 322 extern const char kXcodeTestApplicationName_HelpShort[]; 323 extern const char kXcodeTestApplicationName_Help[]; 324 325 extern const char kTestonly[]; 326 extern const char kTestonly_HelpShort[]; 327 extern const char kTestonly_Help[]; 328 329 extern const char kVisibility[]; 330 extern const char kVisibility_HelpShort[]; 331 extern const char kVisibility_Help[]; 332 333 extern const char kWalkKeys[]; 334 extern const char kWalkKeys_HelpShort[]; 335 extern const char kWalkKeys_Help[]; 336 337 extern const char kWeakFrameworks[]; 338 extern const char kWeakFrameworks_HelpShort[]; 339 extern const char kWeakFrameworks_Help[]; 340 341 extern const char kWriteValueContents[]; 342 extern const char kWriteValueContents_HelpShort[]; 343 extern const char kWriteValueContents_Help[]; 344 345 extern const char kWriteOutputConversion[]; 346 extern const char kWriteOutputConversion_HelpShort[]; 347 extern const char kWriteOutputConversion_Help[]; 348 349 extern const char kWriteRuntimeDeps[]; 350 extern const char kWriteRuntimeDeps_HelpShort[]; 351 extern const char kWriteRuntimeDeps_Help[]; 352 353 extern const char kXcodeExtraAttributes[]; 354 extern const char kXcodeExtraAttributes_HelpShort[]; 355 extern const char kXcodeExtraAttributes_Help[]; 356 357 extern const char kGenDeps[]; 358 extern const char kGenDeps_HelpShort[]; 359 extern const char kGenDeps_Help[]; 360 361 // ----------------------------------------------------------------------------- 362 363 struct VariableInfo { 364 VariableInfo(); 365 VariableInfo(const char* in_help_short, const char* in_help); 366 367 const char* help_short; 368 const char* help; 369 }; 370 371 using VariableInfoMap = std::map<std::string_view, VariableInfo>; 372 373 // Returns the built-in readonly variables. 374 // Note: this is used only for help so this getter is not threadsafe. 375 const VariableInfoMap& GetBuiltinVariables(); 376 377 // Returns the variables used by target generators. 378 // Note: this is used only for help so this getter is not threadsafe. 379 const VariableInfoMap& GetTargetVariables(); 380 381 } // namespace variables 382 383 #endif // TOOLS_GN_VARIABLES_H_ 384