| 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 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 // tool type. There are different validators for the "outputs" than for the | 821 // tool type. There are different validators for the "outputs" than for the |
| 822 // rest of the strings. | 822 // rest of the strings. |
| 823 bool (*subst_validator)(SubstitutionType) = nullptr; | 823 bool (*subst_validator)(SubstitutionType) = nullptr; |
| 824 bool (*subst_output_validator)(SubstitutionType) = nullptr; | 824 bool (*subst_output_validator)(SubstitutionType) = nullptr; |
| 825 if (IsCompilerTool(tool_type)) { | 825 if (IsCompilerTool(tool_type)) { |
| 826 subst_validator = &IsValidCompilerSubstitution; | 826 subst_validator = &IsValidCompilerSubstitution; |
| 827 subst_output_validator = &IsValidCompilerOutputsSubstitution; | 827 subst_output_validator = &IsValidCompilerOutputsSubstitution; |
| 828 } else if (IsLinkerTool(tool_type)) { | 828 } else if (IsLinkerTool(tool_type)) { |
| 829 subst_validator = &IsValidLinkerSubstitution; | 829 subst_validator = &IsValidLinkerSubstitution; |
| 830 subst_output_validator = &IsValidLinkerOutputsSubstitution; | 830 subst_output_validator = &IsValidLinkerOutputsSubstitution; |
| 831 } else if (tool_type == Toolchain::TYPE_COPY || | 831 } else if (tool_type == Toolchain::TYPE_COPY) { |
| 832 tool_type == Toolchain::TYPE_COPY_BUNDLE_DATA) { | |
| 833 subst_validator = &IsValidCopySubstitution; | 832 subst_validator = &IsValidCopySubstitution; |
| 834 subst_output_validator = &IsValidCopySubstitution; | 833 subst_output_validator = &IsValidCopySubstitution; |
| 834 } else if (tool_type == Toolchain::TYPE_COPY_BUNDLE_DATA) { |
| 835 subst_validator = &IsValidCopyBundleDataSubstitution; |
| 836 subst_output_validator = &IsValidCopyBundleDataSubstitution; |
| 835 } else if (tool_type == Toolchain::TYPE_COMPILE_XCASSETS) { | 837 } else if (tool_type == Toolchain::TYPE_COMPILE_XCASSETS) { |
| 836 subst_validator = &IsValidCompileXCassetsSubstitution; | 838 subst_validator = &IsValidCompileXCassetsSubstitution; |
| 837 subst_output_validator = &IsValidCompileXCassetsSubstitution; | 839 subst_output_validator = &IsValidCompileXCassetsSubstitution; |
| 838 } else { | 840 } else { |
| 839 subst_validator = &IsValidToolSubstitution; | 841 subst_validator = &IsValidToolSubstitution; |
| 840 subst_output_validator = &IsValidToolSubstitution; | 842 subst_output_validator = &IsValidToolSubstitution; |
| 841 } | 843 } |
| 842 | 844 |
| 843 scoped_ptr<Tool> tool(new Tool); | 845 scoped_ptr<Tool> tool(new Tool); |
| 844 | 846 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 return Value(); | 1011 return Value(); |
| 1010 | 1012 |
| 1011 Scope::KeyValueMap values; | 1013 Scope::KeyValueMap values; |
| 1012 block_scope.GetCurrentScopeValues(&values); | 1014 block_scope.GetCurrentScopeValues(&values); |
| 1013 toolchain->args() = values; | 1015 toolchain->args() = values; |
| 1014 | 1016 |
| 1015 return Value(); | 1017 return Value(); |
| 1016 } | 1018 } |
| 1017 | 1019 |
| 1018 } // namespace functions | 1020 } // namespace functions |
| OLD | NEW |