| 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 Settings* settings, const Label& label) | 28 Toolchain::Toolchain(const Label& label) : Item(label), is_default_(false) { |
| 29 : Item(settings, label) { | |
| 30 } | 29 } |
| 31 | 30 |
| 32 Toolchain::~Toolchain() { | 31 Toolchain::~Toolchain() { |
| 33 } | 32 } |
| 34 | 33 |
| 35 Toolchain* Toolchain::AsToolchain() { | 34 Toolchain* Toolchain::AsToolchain() { |
| 36 return this; | 35 return this; |
| 37 } | 36 } |
| 38 | 37 |
| 39 const Toolchain* Toolchain::AsToolchain() const { | 38 const Toolchain* Toolchain::AsToolchain() const { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 77 |
| 79 const Toolchain::Tool& Toolchain::GetTool(ToolType type) const { | 78 const Toolchain::Tool& Toolchain::GetTool(ToolType type) const { |
| 80 DCHECK(type != TYPE_NONE); | 79 DCHECK(type != TYPE_NONE); |
| 81 return tools_[static_cast<size_t>(type)]; | 80 return tools_[static_cast<size_t>(type)]; |
| 82 } | 81 } |
| 83 | 82 |
| 84 void Toolchain::SetTool(ToolType type, const Tool& t) { | 83 void Toolchain::SetTool(ToolType type, const Tool& t) { |
| 85 DCHECK(type != TYPE_NONE); | 84 DCHECK(type != TYPE_NONE); |
| 86 tools_[static_cast<size_t>(type)] = t; | 85 tools_[static_cast<size_t>(type)] = t; |
| 87 } | 86 } |
| OLD | NEW |