| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <limits> | 6 #include <limits> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "tools/gn/err.h" | 9 #include "tools/gn/err.h" |
| 10 #include "tools/gn/functions.h" | 10 #include "tools/gn/functions.h" |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 if (IsCompilerTool(tool_type)) { | 809 if (IsCompilerTool(tool_type)) { |
| 810 subst_validator = &IsValidCompilerSubstitution; | 810 subst_validator = &IsValidCompilerSubstitution; |
| 811 subst_output_validator = &IsValidCompilerOutputsSubstitution; | 811 subst_output_validator = &IsValidCompilerOutputsSubstitution; |
| 812 } else if (IsLinkerTool(tool_type)) { | 812 } else if (IsLinkerTool(tool_type)) { |
| 813 subst_validator = &IsValidLinkerSubstitution; | 813 subst_validator = &IsValidLinkerSubstitution; |
| 814 subst_output_validator = &IsValidLinkerOutputsSubstitution; | 814 subst_output_validator = &IsValidLinkerOutputsSubstitution; |
| 815 } else if (tool_type == Toolchain::TYPE_COPY) { | 815 } else if (tool_type == Toolchain::TYPE_COPY) { |
| 816 subst_validator = &IsValidCopySubstitution; | 816 subst_validator = &IsValidCopySubstitution; |
| 817 subst_output_validator = &IsValidCopySubstitution; | 817 subst_output_validator = &IsValidCopySubstitution; |
| 818 } else { | 818 } else { |
| 819 subst_validator = &IsValidToolSubstutition; | 819 subst_validator = &IsValidToolSubstitution; |
| 820 subst_output_validator = &IsValidToolSubstutition; | 820 subst_output_validator = &IsValidToolSubstitution; |
| 821 } | 821 } |
| 822 | 822 |
| 823 scoped_ptr<Tool> tool(new Tool); | 823 scoped_ptr<Tool> tool(new Tool); |
| 824 | 824 |
| 825 if (!ReadPattern(&block_scope, "command", subst_validator, tool.get(), | 825 if (!ReadPattern(&block_scope, "command", subst_validator, tool.get(), |
| 826 &Tool::set_command, err) || | 826 &Tool::set_command, err) || |
| 827 !ReadOutputExtension(&block_scope, tool.get(), err) || | 827 !ReadOutputExtension(&block_scope, tool.get(), err) || |
| 828 !ReadPattern(&block_scope, "depfile", subst_validator, tool.get(), | 828 !ReadPattern(&block_scope, "depfile", subst_validator, tool.get(), |
| 829 &Tool::set_depfile, err) || | 829 &Tool::set_depfile, err) || |
| 830 !ReadDepsFormat(&block_scope, tool.get(), err) || | 830 !ReadDepsFormat(&block_scope, tool.get(), err) || |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 986 return Value(); | 986 return Value(); |
| 987 | 987 |
| 988 Scope::KeyValueMap values; | 988 Scope::KeyValueMap values; |
| 989 block_scope.GetCurrentScopeValues(&values); | 989 block_scope.GetCurrentScopeValues(&values); |
| 990 toolchain->args() = values; | 990 toolchain->args() = values; |
| 991 | 991 |
| 992 return Value(); | 992 return Value(); |
| 993 } | 993 } |
| 994 | 994 |
| 995 } // namespace functions | 995 } // namespace functions |
| OLD | NEW |