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

Method construct

src/tools/stage.py:98–137  ·  view source on GitHub ↗
(self, name, source_targets, ps)

Source from the content-addressed store, hash-verified

96
97
98 def construct(self, name, source_targets, ps):
99
100 source_targets = self.targets_to_stage(source_targets, ps)
101 ps = self.update_location(ps)
102
103 ename = ps.get('name')
104 if ename:
105 ename = ename[0]
106 if ename and len(source_targets) > 1:
107 get_manager().errors()("When <name> property is used in 'install', only one source is allowed")
108
109 result = []
110
111 for i in source_targets:
112
113 staged_targets = []
114 new_ps = self.adjust_properties(i, ps)
115
116 # See if something special should be done when staging this type. It
117 # is indicated by the presence of a special "INSTALLED_" type.
118 t = i.type()
119 if t and b2.build.type.registered("INSTALLED_" + t):
120
121 if ename:
122 get_manager().errors()("In 'install': <name> property specified with target that requires relinking.")
123 else:
124 (r, targets) = generators.construct(self.project(), name, "INSTALLED_" + t,
125 new_ps, [i])
126 assert isinstance(r, property_set.PropertySet)
127 staged_targets.extend(targets)
128
129 else:
130 staged_targets.append(copy_file(self.project(), ename, i, new_ps))
131
132 if not staged_targets:
133 get_manager().errors()("Unable to generate staged version of " + i)
134
135 result.extend(get_manager().virtual_targets().register(t) for t in staged_targets)
136
137 return (property_set.empty(), result)
138
139 def targets_to_stage(self, source_targets, ps):
140 """Given the list of source targets explicitly passed to 'stage', returns the

Callers

nothing calls this directly

Calls 11

targets_to_stageMethod · 0.95
update_locationMethod · 0.95
adjust_propertiesMethod · 0.95
get_managerFunction · 0.90
copy_fileFunction · 0.85
getMethod · 0.80
errorsMethod · 0.80
appendMethod · 0.80
virtual_targetsMethod · 0.80
emptyMethod · 0.80
registerMethod · 0.45

Tested by

no test coverage detected