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 "base/sys_info.h" | 7 #include "base/sys_info.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "tools/gn/variables.h" | 9 #include "tools/gn/variables.h" |
10 | 10 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 #elif defined(OS_NETBSD) | 259 #elif defined(OS_NETBSD) |
260 os = "netbsd"; | 260 os = "netbsd"; |
261 #else | 261 #else |
262 #error Unknown OS type. | 262 #error Unknown OS type. |
263 #endif | 263 #endif |
264 | 264 |
265 // Host architecture. | 265 // Host architecture. |
266 static const char kX86[] = "x86"; | 266 static const char kX86[] = "x86"; |
267 static const char kX64[] = "x64"; | 267 static const char kX64[] = "x64"; |
268 static const char kArm[] = "arm"; | 268 static const char kArm[] = "arm"; |
| 269 static const char kArm64[] = "arm64"; |
269 static const char kMips[] = "mipsel"; | 270 static const char kMips[] = "mipsel"; |
270 static const char kS390X[] = "s390x"; | 271 static const char kS390X[] = "s390x"; |
271 static const char kPPC64[] = "ppc64"; | 272 static const char kPPC64[] = "ppc64"; |
272 const char* arch = nullptr; | 273 const char* arch = nullptr; |
273 | 274 |
274 // Set the host CPU architecture based on the underlying OS, not | 275 // Set the host CPU architecture based on the underlying OS, not |
275 // whatever the current bit-tedness of the GN binary is. | 276 // whatever the current bit-tedness of the GN binary is. |
276 std::string os_arch = base::SysInfo::OperatingSystemArchitecture(); | 277 std::string os_arch = base::SysInfo::OperatingSystemArchitecture(); |
277 if (os_arch == "x86") | 278 if (os_arch == "x86") |
278 arch = kX86; | 279 arch = kX86; |
279 else if (os_arch == "x86_64") | 280 else if (os_arch == "x86_64") |
280 arch = kX64; | 281 arch = kX64; |
281 else if (os_arch.substr(0, 3) == "arm") | 282 else if (os_arch.substr(0, 3) == "arm") |
282 arch = kArm; | 283 arch = kArm; |
| 284 else if (os_arch == "aarch64") |
| 285 arch = kArm64; |
283 else if (os_arch == "mips") | 286 else if (os_arch == "mips") |
284 arch = kMips; | 287 arch = kMips; |
285 else if (os_arch == "s390x") | 288 else if (os_arch == "s390x") |
286 arch = kS390X; | 289 arch = kS390X; |
287 else if (os_arch == "mips") | 290 else if (os_arch == "mips") |
288 arch = kPPC64; | 291 arch = kPPC64; |
289 else | 292 else |
290 CHECK(false) << "OS architecture not handled. (" << os_arch << ")"; | 293 CHECK(false) << "OS architecture not handled. (" << os_arch << ")"; |
291 | 294 |
292 // Save the OS and architecture as build arguments that are implicitly | 295 // Save the OS and architecture as build arguments that are implicitly |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 Scope* scope) const { | 355 Scope* scope) const { |
353 lock_.AssertAcquired(); | 356 lock_.AssertAcquired(); |
354 return declared_arguments_per_toolchain_[scope->settings()]; | 357 return declared_arguments_per_toolchain_[scope->settings()]; |
355 } | 358 } |
356 | 359 |
357 Scope::KeyValueMap& Args::OverridesForToolchainLocked( | 360 Scope::KeyValueMap& Args::OverridesForToolchainLocked( |
358 Scope* scope) const { | 361 Scope* scope) const { |
359 lock_.AssertAcquired(); | 362 lock_.AssertAcquired(); |
360 return toolchain_overrides_[scope->settings()]; | 363 return toolchain_overrides_[scope->settings()]; |
361 } | 364 } |
OLD | NEW |