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

Method HasBuildSetting

tools/gyp/pylib/gyp/xcodeproj_file.py:1716–1748  ·  view source on GitHub ↗

Determines the state of a build setting in all XCBuildConfiguration child objects. If all child objects have key in their build settings, and the value is the same in all child objects, returns 1. If no child objects have the key in their build settings, returns 0.

(self, key)

Source from the content-addressed store, hash-verified

1714 return self.ConfigurationNamed(self._properties["defaultConfigurationName"])
1715
1716 def HasBuildSetting(self, key):
1717 """Determines the state of a build setting in all XCBuildConfiguration
1718 child objects.
1719
1720 If all child objects have key in their build settings, and the value is the
1721 same in all child objects, returns 1.
1722
1723 If no child objects have the key in their build settings, returns 0.
1724
1725 If some, but not all, child objects have the key in their build settings,
1726 or if any children have different values for the key, returns -1.
1727 """
1728
1729 has = None
1730 value = None
1731 for configuration in self._properties["buildConfigurations"]:
1732 configuration_has = configuration.HasBuildSetting(key)
1733 if has is None:
1734 has = configuration_has
1735 elif has != configuration_has:
1736 return -1
1737
1738 if configuration_has:
1739 configuration_value = configuration.GetBuildSetting(key)
1740 if value is None:
1741 value = configuration_value
1742 elif value != configuration_value:
1743 return -1
1744
1745 if not has:
1746 return 0
1747
1748 return 1
1749
1750 def GetBuildSetting(self, key):
1751 """Gets the build setting for key.

Callers

nothing calls this directly

Calls 2

HasBuildSettingMethod · 0.45
GetBuildSettingMethod · 0.45

Tested by

no test coverage detected