MCPcopy Create free account
hub / github.com/boostorg/build / process

Method process

v2/tools/rc.py:137–186  ·  view source on GitHub ↗
(self, target, matches, binding)

Source from the content-addressed store, hash-verified

135 "[ ]+([^ \"]+|\"[^\"]+\"))|(#include[ ]*(<[^<]+>|\"[^\"]+\")))" ;
136
137 def process(self, target, matches, binding):
138
139 angle = regex.transform(matches, "#include[ ]*<([^<]+)>")
140 quoted = regex.transform(matches, "#include[ ]*\"([^\"]+)\"")
141 res = regex.transform(matches,
142 "[^ ]+[ ]+(BITMAP|CURSOR|FONT|ICON|MESSAGETABLE|RT_MANIFEST)" +\
143 "[ ]+(([^ \"]+)|\"([^\"]+)\")", [3, 4])
144
145 # Icons and other includes may referenced as
146 #
147 # IDR_MAINFRAME ICON "res\\icon.ico"
148 #
149 # so we have to replace double backslashes to single ones.
150 res = [ re.sub(r'\\\\', '/', match) for match in res ]
151
152 # CONSIDER: the new scoping rule seem to defeat "on target" variables.
153 g = bjam.call('get-target-variable', target, 'HDRGRIST')
154 b = os.path.normalize_path(os.path.dirname(binding))
155
156 # Attach binding of including file to included targets.
157 # When target is directly created from virtual target
158 # this extra information is unnecessary. But in other
159 # cases, it allows to distinguish between two headers of the
160 # same name included from different places.
161 # We don't need this extra information for angle includes,
162 # since they should not depend on including file (we can't
163 # get literal "." in include path).
164 g2 = g + "#" + b
165
166 g = "<" + g + ">"
167 g2 = "<" + g2 + ">"
168 angle = [g + x for x in angle]
169 quoted = [g2 + x for x in quoted]
170 res = [g2 + x for x in res]
171
172 all = angle + quoted
173
174 bjam.call('mark-included', target, all)
175
176 engine = get_manager().engine()
177
178 engine.add_dependency(target, res)
179 bjam.call('NOCARE', all + res)
180 engine.set_target_variable(angle, 'SEARCH', ungrist(self.includes))
181 engine.set_target_variable(quoted, 'SEARCH', b + ungrist(self.includes))
182 engine.set_target_variable(res, 'SEARCH', b + ungrist(self.includes)) ;
183
184 # Just propagate current scanner to includes, in a hope
185 # that includes do not change scanners.
186 get_manager().scanners().propagate(self, angle + quoted)
187
188scanner.register(ResScanner, 'include')
189type.set_scanner('RC', ResScanner)

Callers

nothing calls this directly

Calls 4

get_managerFunction · 0.90
ungristFunction · 0.85
engineMethod · 0.80
scannersMethod · 0.80

Tested by

no test coverage detected