MCPcopy Create free account
hub / github.com/nodejs/node / Finalize1

Method Finalize1

tools/gyp/pylib/gyp/generator/xcode.py:138–386  ·  view source on GitHub ↗
(self, xcode_targets, serialize_all_tests)

Source from the content-addressed store, hash-verified

136 raise
137
138 def Finalize1(self, xcode_targets, serialize_all_tests):
139 # Collect a list of all of the build configuration names used by the
140 # various targets in the file. It is very heavily advised to keep each
141 # target in an entire project (even across multiple project files) using
142 # the same set of configuration names.
143 configurations = []
144 for xct in self.project.GetProperty("targets"):
145 xccl = xct.GetProperty("buildConfigurationList")
146 xcbcs = xccl.GetProperty("buildConfigurations")
147 for xcbc in xcbcs:
148 name = xcbc.GetProperty("name")
149 if name not in configurations:
150 configurations.append(name)
151
152 # Replace the XCConfigurationList attached to the PBXProject object with
153 # a new one specifying all of the configuration names used by the various
154 # targets.
155 try:
156 xccl = CreateXCConfigurationList(configurations)
157 self.project.SetProperty("buildConfigurationList", xccl)
158 except Exception:
159 sys.stderr.write("Problem with gyp file %s\n" % self.gyp_path)
160 raise
161
162 # The need for this setting is explained above where _intermediate_var is
163 # defined. The comments below about wanting to avoid project-wide build
164 # settings apply here too, but this needs to be set on a project-wide basis
165 # so that files relative to the _intermediate_var setting can be displayed
166 # properly in the Xcode UI.
167 #
168 # Note that for configuration-relative files such as anything relative to
169 # _intermediate_var, for the purposes of UI tree view display, Xcode will
170 # only resolve the configuration name once, when the project file is
171 # opened. If the active build configuration is changed, the project file
172 # must be closed and reopened if it is desired for the tree view to update.
173 # This is filed as Apple radar 6588391.
174 xccl.SetBuildSetting(
175 _intermediate_var, "$(PROJECT_DERIVED_FILE_DIR)/$(CONFIGURATION)"
176 )
177 xccl.SetBuildSetting(
178 _shared_intermediate_var, "$(SYMROOT)/DerivedSources/$(CONFIGURATION)"
179 )
180
181 # Set user-specified project-wide build settings and config files. This
182 # is intended to be used very sparingly. Really, almost everything should
183 # go into target-specific build settings sections. The project-wide
184 # settings are only intended to be used in cases where Xcode attempts to
185 # resolve variable references in a project context as opposed to a target
186 # context, such as when resolving sourceTree references while building up
187 # the tree tree view for UI display.
188 # Any values set globally are applied to all configurations, then any
189 # per-configuration values are applied.
190 for xck, xcv in self.build_file_dict.get("xcode_settings", {}).items():
191 xccl.SetBuildSetting(xck, xcv)
192 if "xcode_config_file" in self.build_file_dict:
193 config_ref = self.project.AddOrGetFileInRootGroup(
194 self.build_file_dict["xcode_config_file"]
195 )

Callers 1

GenerateOutputFunction · 0.80

Calls 15

intFunction · 0.85
GetPropertyMethod · 0.80
SetPropertyMethod · 0.80
AppendPropertyMethod · 0.80
SortGroupsMethod · 0.80
getMethod · 0.65
appendMethod · 0.45
writeMethod · 0.45
SetBuildSettingMethod · 0.45

Tested by

no test coverage detected