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 <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "tools/gn/target.h" | 10 #include "tools/gn/target.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 95 } |
96 | 96 |
97 setup_complete_ = true; | 97 setup_complete_ = true; |
98 } | 98 } |
99 | 99 |
100 // static | 100 // static |
101 Toolchain::ToolType Toolchain::GetToolTypeForSourceType(SourceFileType type) { | 101 Toolchain::ToolType Toolchain::GetToolTypeForSourceType(SourceFileType type) { |
102 switch (type) { | 102 switch (type) { |
103 case SOURCE_C: | 103 case SOURCE_C: |
104 return TYPE_CC; | 104 return TYPE_CC; |
105 case SOURCE_CC: | 105 case SOURCE_CPP: |
106 return TYPE_CXX; | 106 return TYPE_CXX; |
107 case SOURCE_M: | 107 case SOURCE_M: |
108 return TYPE_OBJC; | 108 return TYPE_OBJC; |
109 case SOURCE_MM: | 109 case SOURCE_MM: |
110 return TYPE_OBJCXX; | 110 return TYPE_OBJCXX; |
111 case SOURCE_ASM: | 111 case SOURCE_ASM: |
112 case SOURCE_S: | 112 case SOURCE_S: |
113 return TYPE_ASM; | 113 return TYPE_ASM; |
114 case SOURCE_RC: | 114 case SOURCE_RC: |
115 return TYPE_RC; | 115 return TYPE_RC; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 return TYPE_STAMP; | 150 return TYPE_STAMP; |
151 default: | 151 default: |
152 NOTREACHED(); | 152 NOTREACHED(); |
153 return Toolchain::TYPE_NONE; | 153 return Toolchain::TYPE_NONE; |
154 } | 154 } |
155 } | 155 } |
156 | 156 |
157 const Tool* Toolchain::GetToolForTargetFinalOutput(const Target* target) const { | 157 const Tool* Toolchain::GetToolForTargetFinalOutput(const Target* target) const { |
158 return tools_[GetToolTypeForTargetFinalOutput(target)].get(); | 158 return tools_[GetToolTypeForTargetFinalOutput(target)].get(); |
159 } | 159 } |
OLD | NEW |