Index: pylib/gyp/xcode_emulation.py |
diff --git a/pylib/gyp/xcode_emulation.py b/pylib/gyp/xcode_emulation.py |
index 92bf47e2cd5b876fe3c516fc3a7afdc82c5a518c..16388c8e03c579653a0b952c28822d87c8e60880 100644 |
--- a/pylib/gyp/xcode_emulation.py |
+++ b/pylib/gyp/xcode_emulation.py |
@@ -221,6 +221,12 @@ class XcodeSettings(object): |
def _IsIosAppExtension(self): |
return int(self.spec.get('ios_app_extension', 0)) != 0 |
+ def _IsIosWatchKitExtension(self): |
+ return int(self.spec.get('ios_watchkit_extension', 0)) != 0 |
+ |
+ def _IsIosWatchApp(self): |
+ return int(self.spec.get('ios_watch_app', 0)) != 0 |
+ |
def GetFrameworkVersion(self): |
"""Returns the framework version of the current target. Only valid for |
bundles.""" |
@@ -240,7 +246,7 @@ class XcodeSettings(object): |
'WRAPPER_EXTENSION', default=default_wrapper_extension) |
return '.' + self.spec.get('product_extension', wrapper_extension) |
elif self.spec['type'] == 'executable': |
- if self._IsIosAppExtension(): |
+ if self._IsIosAppExtension() or self._IsIosWatchKitExtension(): |
return '.' + self.spec.get('product_extension', 'appex') |
else: |
return '.' + self.spec.get('product_extension', 'app') |
@@ -302,6 +308,14 @@ class XcodeSettings(object): |
assert self._IsBundle(), ('ios_app_extension flag requires mac_bundle ' |
'(target %s)' % self.spec['target_name']) |
return 'com.apple.product-type.app-extension' |
+ if self._IsIosWatchKitExtension(): |
+ assert self._IsBundle(), ('ios_watchkit_extension flag requires ' |
+ 'mac_bundle (target %s)' % self.spec['target_name']) |
+ return 'com.apple.product-type.watchkit-extension' |
+ if self._IsIosWatchApp(): |
+ assert self._IsBundle(), ('ios_watch_app flag requires mac_bundle ' |
+ '(target %s)' % self.spec['target_name']) |
+ return 'com.apple.product-type.application.watchapp' |
if self._IsBundle(): |
return { |
'executable': 'com.apple.product-type.application', |
@@ -804,7 +818,8 @@ class XcodeSettings(object): |
for directory in framework_dirs: |
ldflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root)) |
- if sdk_root and self._IsIosAppExtension(): |
+ is_extension = self._IsIosAppExtension() or self._IsIosWatchKitExtension() |
+ if sdk_root and is_extension: |
# Adds the link flags for extensions. These flags are common for all |
# extensions and provide loader and main function. |
# These flags reflect the compilation options used by xcode to compile |