OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "tools/gn/args.h" | 5 #include "tools/gn/args.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "tools/gn/variables.h" | 8 #include "tools/gn/variables.h" |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 "The variable \"" + i->first.as_string() + "\" was set as a build " | 156 "The variable \"" + i->first.as_string() + "\" was set as a build " |
157 "argument\nbut never appeared in a declare_args() block in any " | 157 "argument\nbut never appeared in a declare_args() block in any " |
158 "buildfile."); | 158 "buildfile."); |
159 return false; | 159 return false; |
160 } | 160 } |
161 } | 161 } |
162 return true; | 162 return true; |
163 } | 163 } |
164 | 164 |
165 void Args::SetSystemVars(Scope* dest) const { | 165 void Args::SetSystemVars(Scope* dest) const { |
| 166 base::AutoLock lock(lock_); |
| 167 |
166 // Host OS. | 168 // Host OS. |
167 const char* os = NULL; | 169 const char* os = NULL; |
168 #if defined(OS_WIN) | 170 #if defined(OS_WIN) |
169 os = "win"; | 171 os = "win"; |
170 #elif defined(OS_MACOSX) | 172 #elif defined(OS_MACOSX) |
171 os = "mac"; | 173 os = "mac"; |
172 #elif defined(OS_LINUX) | 174 #elif defined(OS_LINUX) |
173 os = "linux"; | 175 os = "linux"; |
174 #else | 176 #else |
175 #error Unknown OS type. | 177 #error Unknown OS type. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 i != values.end(); ++i) | 242 i != values.end(); ++i) |
241 scope->SetValue(i->first, i->second, i->second.origin()); | 243 scope->SetValue(i->first, i->second, i->second.origin()); |
242 } | 244 } |
243 | 245 |
244 void Args::SaveOverrideRecord(const Scope::KeyValueMap& values) const { | 246 void Args::SaveOverrideRecord(const Scope::KeyValueMap& values) const { |
245 base::AutoLock lock(lock_); | 247 base::AutoLock lock(lock_); |
246 for (Scope::KeyValueMap::const_iterator i = values.begin(); | 248 for (Scope::KeyValueMap::const_iterator i = values.begin(); |
247 i != values.end(); ++i) | 249 i != values.end(); ++i) |
248 all_overrides_[i->first] = i->second; | 250 all_overrides_[i->first] = i->second; |
249 } | 251 } |
OLD | NEW |