Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: pylib/gyp/xcode_emulation.py

Issue 376603002: This CL adds support for extension in GYP. (Closed) Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: extension -> ios-app-extension Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pylib/gyp/xcode_emulation.py
diff --git a/pylib/gyp/xcode_emulation.py b/pylib/gyp/xcode_emulation.py
index 859cd5a93722e9c1efb9f4cb210be180e03e7b11..c3d3aee899ec2c7bed60db5a099abddbfe6527ad 100644
--- a/pylib/gyp/xcode_emulation.py
+++ b/pylib/gyp/xcode_emulation.py
@@ -218,6 +218,9 @@ class XcodeSettings(object):
def _IsBundle(self):
return int(self.spec.get('mac_bundle', 0)) != 0
+ def _IsIosAppExtension(self):
+ return int(self.spec.get('ios_app_extension', 0)) != 0
Mark Mentovai 2014/07/09 18:02:52 You can require (assert) that _IsBundle is true if
olivierrobin 2014/07/10 09:31:51 Done on line 302 On 2014/07/09 18:02:52, Mark Men
+
def GetFrameworkVersion(self):
"""Returns the framework version of the current target. Only valid for
bundles."""
@@ -237,7 +240,10 @@ class XcodeSettings(object):
'WRAPPER_EXTENSION', default=default_wrapper_extension)
return '.' + self.spec.get('product_extension', wrapper_extension)
elif self.spec['type'] == 'executable':
- return '.' + self.spec.get('product_extension', 'app')
+ if self._IsIosAppExtension:
+ return '.' + self.spec.get('product_extension', 'appex')
+ else:
+ return '.' + self.spec.get('product_extension', 'app')
else:
assert False, "Don't know extension for '%s', target '%s'" % (
self.spec['type'], self.spec['target_name'])
@@ -292,6 +298,8 @@ class XcodeSettings(object):
def GetProductType(self):
"""Returns the PRODUCT_TYPE of this target."""
+ if self._IsIosAppExtension():
+ return 'com.apple.product-type.app-extension'
if self._IsBundle():
return {
'executable': 'com.apple.product-type.application',
@@ -794,6 +802,16 @@ class XcodeSettings(object):
for directory in framework_dirs:
ldflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root))
+ if sdk_root and self._IsIosAppExtension():
+ # 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
+ # extensions.
+ ldflags.append('-lpkstart ' + sdk_root +
Mark Mentovai 2014/07/09 18:02:52 Some of the other flags in here set a bad example,
olivierrobin 2014/07/10 09:31:51 Done.
olivierrobin 2014/07/10 09:31:51 Done.
+ '/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit')
+ ldflags.append('-fapplication-extension ' +
Mark Mentovai 2014/07/09 18:02:51 And these should be 5 separate arguments.
olivierrobin 2014/07/10 09:31:51 I separated fapplication-extension from the others
+ '-Xlinker -rpath -Xlinker @executable_path/../../Frameworks')
+
self._Appendf(ldflags, 'CLANG_CXX_LIBRARY', '-stdlib=%s')
self.configname = None
@@ -921,7 +939,7 @@ class XcodeSettings(object):
"""Return a shell command to codesign the iOS output binary so it can
be deployed to a device. This should be run as the very last step of the
build."""
- if not (self.isIOS and self.spec['type'] == "executable"):
+ if not (self.isIOS and self.spec['type'] == 'executable'):
return []
settings = self.xcode_settings[configname]

Powered by Google App Engine
This is Rietveld 408576698