OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/substitution_type.h" | 5 #include "tools/gn/substitution_type.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include "tools/gn/err.h" | 9 #include "tools/gn/err.h" |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 "{{cflags_objcc}}", // SUBSTITUTION_CFLAGS_OBJCC | 36 "{{cflags_objcc}}", // SUBSTITUTION_CFLAGS_OBJCC |
37 "{{defines}}", // SUBSTITUTION_DEFINES | 37 "{{defines}}", // SUBSTITUTION_DEFINES |
38 "{{include_dirs}}", // SUBSTITUTION_INCLUDE_DIRS | 38 "{{include_dirs}}", // SUBSTITUTION_INCLUDE_DIRS |
39 | 39 |
40 "{{inputs}}", // SUBSTITUTION_LINKER_INPUTS | 40 "{{inputs}}", // SUBSTITUTION_LINKER_INPUTS |
41 "{{inputs_newline}}", // SUBSTITUTION_LINKER_INPUTS_NEWLINE | 41 "{{inputs_newline}}", // SUBSTITUTION_LINKER_INPUTS_NEWLINE |
42 "{{ldflags}}", // SUBSTITUTION_LDFLAGS | 42 "{{ldflags}}", // SUBSTITUTION_LDFLAGS |
43 "{{libs}}", // SUBSTITUTION_LIBS | 43 "{{libs}}", // SUBSTITUTION_LIBS |
44 "{{output_extension}}", // SUBSTITUTION_OUTPUT_EXTENSION | 44 "{{output_extension}}", // SUBSTITUTION_OUTPUT_EXTENSION |
45 "{{solibs}}", // SUBSTITUTION_SOLIBS | 45 "{{solibs}}", // SUBSTITUTION_SOLIBS |
| 46 |
| 47 "{{response_file_name}}", // SUBSTITUTION_RSP_FILE_NAME |
46 }; | 48 }; |
47 | 49 |
48 const char* kSubstitutionNinjaNames[SUBSTITUTION_NUM_TYPES] = { | 50 const char* kSubstitutionNinjaNames[SUBSTITUTION_NUM_TYPES] = { |
49 nullptr, // SUBSTITUTION_LITERAL | 51 nullptr, // SUBSTITUTION_LITERAL |
50 | 52 |
51 "in", // SUBSTITUTION_SOURCE | 53 "in", // SUBSTITUTION_SOURCE |
52 "out", // SUBSTITUTION_OUTPUT | 54 "out", // SUBSTITUTION_OUTPUT |
53 | 55 |
54 "source_name_part", // SUBSTITUTION_NAME_PART | 56 "source_name_part", // SUBSTITUTION_NAME_PART |
55 "source_file_part", // SUBSTITUTION_FILE_PART | 57 "source_file_part", // SUBSTITUTION_FILE_PART |
(...skipping 20 matching lines...) Expand all Loading... |
76 | 78 |
77 // LINKER_INPUTS expands to the same Ninja var as SUBSTITUTION_SOURCE. These | 79 // LINKER_INPUTS expands to the same Ninja var as SUBSTITUTION_SOURCE. These |
78 // are used in different contexts and are named differently to keep things | 80 // are used in different contexts and are named differently to keep things |
79 // clear, but they both expand to the "set of input files" for a build rule. | 81 // clear, but they both expand to the "set of input files" for a build rule. |
80 "in", // SUBSTITUTION_LINKER_INPUTS | 82 "in", // SUBSTITUTION_LINKER_INPUTS |
81 "in_newline", // SUBSTITUTION_LINKER_INPUTS_NEWLINE | 83 "in_newline", // SUBSTITUTION_LINKER_INPUTS_NEWLINE |
82 "ldflags", // SUBSTITUTION_LDFLAGS | 84 "ldflags", // SUBSTITUTION_LDFLAGS |
83 "libs", // SUBSTITUTION_LIBS | 85 "libs", // SUBSTITUTION_LIBS |
84 "output_extension", // SUBSTITUTION_OUTPUT_EXTENSION | 86 "output_extension", // SUBSTITUTION_OUTPUT_EXTENSION |
85 "solibs", // SUBSTITUTION_SOLIBS | 87 "solibs", // SUBSTITUTION_SOLIBS |
| 88 |
| 89 "rspfile", // SUBSTITUTION_RSP_FILE_NAME |
86 }; | 90 }; |
87 | 91 |
88 SubstitutionBits::SubstitutionBits() : used() { | 92 SubstitutionBits::SubstitutionBits() : used() { |
89 } | 93 } |
90 | 94 |
91 void SubstitutionBits::MergeFrom(const SubstitutionBits& other) { | 95 void SubstitutionBits::MergeFrom(const SubstitutionBits& other) { |
92 for (size_t i = 0; i < SUBSTITUTION_NUM_TYPES; i++) | 96 for (size_t i = 0; i < SUBSTITUTION_NUM_TYPES; i++) |
93 used[i] |= other.used[i]; | 97 used[i] |= other.used[i]; |
94 } | 98 } |
95 | 99 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 if (!IsValidSourceSubstitution(types[i])) { | 184 if (!IsValidSourceSubstitution(types[i])) { |
181 *err = Err(origin, "Invalid substitution type.", | 185 *err = Err(origin, "Invalid substitution type.", |
182 "The substitution " + std::string(kSubstitutionNames[i]) + | 186 "The substitution " + std::string(kSubstitutionNames[i]) + |
183 " isn't valid for something\n" | 187 " isn't valid for something\n" |
184 "operating on a source file such as this."); | 188 "operating on a source file such as this."); |
185 return false; | 189 return false; |
186 } | 190 } |
187 } | 191 } |
188 return true; | 192 return true; |
189 } | 193 } |
OLD | NEW |