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 10 #include "base/strings/string_piece.h" 11 12 namespace variables { 13 14 // Builtin vars ---------------------------------------------------------------- 15 16 extern const char kBuildCpuArch[]; 17 extern const char kBuildCpuArch_HelpShort[]; 18 extern const char kBuildCpuArch_Help[]; 19 20 extern const char kBuildOs[]; 21 extern const char kBuildOs_HelpShort[]; 22 extern const char kBuildOs_Help[]; 23 24 extern const char kComponentMode[]; 25 extern const char kComponentMode_HelpShort[]; 26 extern const char kComponentMode_Help[]; 27 28 extern const char kCpuArch[]; 29 extern const char kCpuArch_HelpShort[]; 30 extern const char kCpuArch_Help[]; 31 32 extern const char kCurrentToolchain[]; 33 extern const char kCurrentToolchain_HelpShort[]; 34 extern const char kCurrentToolchain_Help[]; 35 36 extern const char kDefaultToolchain[]; 37 extern const char kDefaultToolchain_HelpShort[]; 38 extern const char kDefaultToolchain_Help[]; 39 40 extern const char kOs[]; 41 extern const char kOs_HelpShort[]; 42 extern const char kOs_Help[]; 43 44 extern const char kPythonPath[]; 45 extern const char kPythonPath_HelpShort[]; 46 extern const char kPythonPath_Help[]; 47 48 extern const char kRootBuildDir[]; 49 extern const char kRootBuildDir_HelpShort[]; 50 extern const char kRootBuildDir_Help[]; 51 52 extern const char kRootGenDir[]; 53 extern const char kRootGenDir_HelpShort[]; 54 extern const char kRootGenDir_Help[]; 55 56 extern const char kRootOutDir[]; 57 extern const char kRootOutDir_HelpShort[]; 58 extern const char kRootOutDir_Help[]; 59 60 extern const char kTargetGenDir[]; 61 extern const char kTargetGenDir_HelpShort[]; 62 extern const char kTargetGenDir_Help[]; 63 64 extern const char kTargetOutDir[]; 65 extern const char kTargetOutDir_HelpShort[]; 66 extern const char kTargetOutDir_Help[]; 67 68 // Target vars ----------------------------------------------------------------- 69 70 extern const char kAllDependentConfigs[]; 71 extern const char kAllDependentConfigs_HelpShort[]; 72 extern const char kAllDependentConfigs_Help[]; 73 74 extern const char kArgs[]; 75 extern const char kArgs_HelpShort[]; 76 extern const char kArgs_Help[]; 77 78 extern const char kCflags[]; 79 extern const char kCflags_HelpShort[]; 80 extern const char* kCflags_Help; 81 82 extern const char kCflagsC[]; 83 extern const char kCflagsC_HelpShort[]; 84 extern const char* kCflagsC_Help; 85 86 extern const char kCflagsCC[]; 87 extern const char kCflagsCC_HelpShort[]; 88 extern const char* kCflagsCC_Help; 89 90 extern const char kCflagsObjC[]; 91 extern const char kCflagsObjC_HelpShort[]; 92 extern const char* kCflagsObjC_Help; 93 94 extern const char kCflagsObjCC[]; 95 extern const char kCflagsObjCC_HelpShort[]; 96 extern const char* kCflagsObjCC_Help; 97 98 extern const char kConfigs[]; 99 extern const char kConfigs_HelpShort[]; 100 extern const char kConfigs_Help[]; 101 102 extern const char kData[]; 103 extern const char kData_HelpShort[]; 104 extern const char kData_Help[]; 105 106 extern const char kDatadeps[]; 107 extern const char kDatadeps_HelpShort[]; 108 extern const char kDatadeps_Help[]; 109 110 extern const char kDefines[]; 111 extern const char kDefines_HelpShort[]; 112 extern const char kDefines_Help[]; 113 114 extern const char kDepfile[]; 115 extern const char kDepfile_HelpShort[]; 116 extern const char kDepfile_Help[]; 117 118 extern const char kDeps[]; 119 extern const char kDeps_HelpShort[]; 120 extern const char kDeps_Help[]; 121 122 extern const char kDirectDependentConfigs[]; 123 extern const char kDirectDependentConfigs_HelpShort[]; 124 extern const char kDirectDependentConfigs_Help[]; 125 126 extern const char kForwardDependentConfigsFrom[]; 127 extern const char kForwardDependentConfigsFrom_HelpShort[]; 128 extern const char kForwardDependentConfigsFrom_Help[]; 129 130 extern const char kIncludeDirs[]; 131 extern const char kIncludeDirs_HelpShort[]; 132 extern const char kIncludeDirs_Help[]; 133 134 extern const char kInputs[]; 135 extern const char kInputs_HelpShort[]; 136 extern const char kInputs_Help[]; 137 138 extern const char kLdflags[]; 139 extern const char kLdflags_HelpShort[]; 140 extern const char kLdflags_Help[]; 141 142 extern const char kLibDirs[]; 143 extern const char kLibDirs_HelpShort[]; 144 extern const char kLibDirs_Help[]; 145 146 extern const char kLibs[]; 147 extern const char kLibs_HelpShort[]; 148 extern const char kLibs_Help[]; 149 150 extern const char kOutputExtension[]; 151 extern const char kOutputExtension_HelpShort[]; 152 extern const char kOutputExtension_Help[]; 153 154 extern const char kOutputName[]; 155 extern const char kOutputName_HelpShort[]; 156 extern const char kOutputName_Help[]; 157 158 extern const char kOutputs[]; 159 extern const char kOutputs_HelpShort[]; 160 extern const char kOutputs_Help[]; 161 162 extern const char kPublic[]; 163 extern const char kPublic_HelpShort[]; 164 extern const char kPublic_Help[]; 165 166 extern const char kScript[]; 167 extern const char kScript_HelpShort[]; 168 extern const char kScript_Help[]; 169 170 extern const char kSources[]; 171 extern const char kSources_HelpShort[]; 172 extern const char kSources_Help[]; 173 174 extern const char kVisibility[]; 175 extern const char kVisibility_HelpShort[]; 176 extern const char kVisibility_Help[]; 177 178 // ----------------------------------------------------------------------------- 179 180 struct VariableInfo { 181 VariableInfo(); 182 VariableInfo(const char* in_help_short, 183 const char* in_help); 184 185 const char* help_short; 186 const char* help; 187 }; 188 189 typedef std::map<base::StringPiece, VariableInfo> VariableInfoMap; 190 191 // Returns the built-in readonly variables. 192 // Note: this is used only for help so this getter is not threadsafe. 193 const VariableInfoMap& GetBuiltinVariables(); 194 195 // Returns the variables used by target generators. 196 // Note: this is used only for help so this getter is not threadsafe. 197 const VariableInfoMap& GetTargetVariables(); 198 199 } // namespace variables 200 201 #endif // TOOLS_GN_VARIABLES_H_ 202