(data)
| 323 | # Processes toolsets in all the targets. This recurses into condition entries |
| 324 | # since they can contain toolsets as well. |
| 325 | def ProcessToolsetsInDict(data): |
| 326 | if "targets" in data: |
| 327 | target_list = data["targets"] |
| 328 | new_target_list = [] |
| 329 | for target in target_list: |
| 330 | # If this target already has an explicit 'toolset', and no 'toolsets' |
| 331 | # list, don't modify it further. |
| 332 | if "toolset" in target and "toolsets" not in target: |
| 333 | new_target_list.append(target) |
| 334 | continue |
| 335 | if multiple_toolsets: |
| 336 | toolsets = target.get("toolsets", ["target"]) |
| 337 | else: |
| 338 | toolsets = ["target"] |
| 339 | # Make sure this 'toolsets' definition is only processed once. |
| 340 | if "toolsets" in target: |
| 341 | del target["toolsets"] |
| 342 | if len(toolsets) > 0: |
| 343 | # Optimization: only do copies if more than one toolset is specified. |
| 344 | for build in toolsets[1:]: |
| 345 | new_target = gyp.simple_copy.deepcopy(target) |
| 346 | new_target["toolset"] = build |
| 347 | new_target_list.append(new_target) |
| 348 | target["toolset"] = toolsets[0] |
| 349 | new_target_list.append(target) |
| 350 | data["targets"] = new_target_list |
| 351 | if "conditions" in data: |
| 352 | for condition in data["conditions"]: |
| 353 | if isinstance(condition, list): |
| 354 | for condition_dict in condition[1:]: |
| 355 | if isinstance(condition_dict, dict): |
| 356 | ProcessToolsetsInDict(condition_dict) |
| 357 | |
| 358 | |
| 359 | # TODO(mark): I don't love this name. It just means that it's going to load |
no test coverage detected