| 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/toolchain.h" | 5 #include "tools/gn/toolchain.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "tools/gn/value.h" | 8 #include "tools/gn/value.h" |
| 9 | 9 |
| 10 const char* Toolchain::kToolCc = "cc"; | 10 const char* Toolchain::kToolCc = "cc"; |
| 11 const char* Toolchain::kToolCxx = "cxx"; | 11 const char* Toolchain::kToolCxx = "cxx"; |
| 12 const char* Toolchain::kToolObjC = "objc"; | 12 const char* Toolchain::kToolObjC = "objc"; |
| 13 const char* Toolchain::kToolObjCxx = "objcxx"; | 13 const char* Toolchain::kToolObjCxx = "objcxx"; |
| 14 const char* Toolchain::kToolRc = "rc"; | 14 const char* Toolchain::kToolRc = "rc"; |
| 15 const char* Toolchain::kToolAsm = "asm"; | 15 const char* Toolchain::kToolAsm = "asm"; |
| 16 const char* Toolchain::kToolAlink = "alink"; | 16 const char* Toolchain::kToolAlink = "alink"; |
| 17 const char* Toolchain::kToolSolink = "solink"; | 17 const char* Toolchain::kToolSolink = "solink"; |
| 18 const char* Toolchain::kToolLink = "link"; | 18 const char* Toolchain::kToolLink = "link"; |
| 19 const char* Toolchain::kToolStamp = "stamp"; | 19 const char* Toolchain::kToolStamp = "stamp"; |
| 20 const char* Toolchain::kToolCopy = "copy"; | 20 const char* Toolchain::kToolCopy = "copy"; |
| 21 | 21 |
| 22 Toolchain::Tool::Tool() { | 22 Toolchain::Tool::Tool() { |
| 23 } | 23 } |
| 24 | 24 |
| 25 Toolchain::Tool::~Tool() { | 25 Toolchain::Tool::~Tool() { |
| 26 } | 26 } |
| 27 | 27 |
| 28 Toolchain::Toolchain(const Label& label) : Item(label), is_default_(false) { | 28 Toolchain::Toolchain(const Settings* settings, const Label& label) |
| 29 : Item(settings, label) { |
| 29 } | 30 } |
| 30 | 31 |
| 31 Toolchain::~Toolchain() { | 32 Toolchain::~Toolchain() { |
| 32 } | 33 } |
| 33 | 34 |
| 34 Toolchain* Toolchain::AsToolchain() { | 35 Toolchain* Toolchain::AsToolchain() { |
| 35 return this; | 36 return this; |
| 36 } | 37 } |
| 37 | 38 |
| 38 const Toolchain* Toolchain::AsToolchain() const { | 39 const Toolchain* Toolchain::AsToolchain() const { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 78 |
| 78 const Toolchain::Tool& Toolchain::GetTool(ToolType type) const { | 79 const Toolchain::Tool& Toolchain::GetTool(ToolType type) const { |
| 79 DCHECK(type != TYPE_NONE); | 80 DCHECK(type != TYPE_NONE); |
| 80 return tools_[static_cast<size_t>(type)]; | 81 return tools_[static_cast<size_t>(type)]; |
| 81 } | 82 } |
| 82 | 83 |
| 83 void Toolchain::SetTool(ToolType type, const Tool& t) { | 84 void Toolchain::SetTool(ToolType type, const Tool& t) { |
| 84 DCHECK(type != TYPE_NONE); | 85 DCHECK(type != TYPE_NONE); |
| 85 tools_[static_cast<size_t>(type)] = t; | 86 tools_[static_cast<size_t>(type)] = t; |
| 86 } | 87 } |
| OLD | NEW |