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

Issue 1160773005: Support for Swift language and Clang modules for ninja generator.

Created:
5 years, 6 months ago by efimovmichael
Modified:
5 years, 3 months ago
Reviewers:
Nico
CC:
gyp-developer_googlegroups.com
Base URL:
https://chromium.googlesource.com/external/gyp@master
Target Ref:
refs/heads/master
Project:
gyp
Visibility:
Public.

Description

Support for Swift language and Clang modules for ninja generator. The main purpose of this patch is to add support for the Swift language. It also adds support for Clang modules, since Swift language depends directly on them. There are also some fixes to support frameworks building for iOS. However frameworks support for both Mac and iOS is not complete yet. There is a feature called 'frameworks embedding'(that is copying some parts of the framework into the app bundle) which is not implemented yet for neither xcode generator nor ninja. It cannot be implemented as a plain copy, since it implies codesigning framework for device builds. I'm going to make another patch for this feature. BUG=https://code.google.com/p/gyp/issues/detail?id=459 R=dpranke@chromium.org

Patch Set 1 #

Total comments: 2

Patch Set 2 : Added support for Swift whole module optimization #

Patch Set 3 : Updated Swift support #

Patch Set 4 : Updated Swift support #

Patch Set 5 : Some fixes for Swift compilation process #

Patch Set 6 : Fixed rare build failure when compiling with modules for multiple archs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1365 lines, -38 lines) Patch
M pylib/gyp/generator/ninja.py View 1 2 3 4 14 chunks +369 lines, -2 lines 0 comments Download
M pylib/gyp/mac_tool.py View 1 2 3 4 3 chunks +60 lines, -1 line 0 comments Download
M pylib/gyp/xcode_emulation.py View 1 2 3 4 5 9 chunks +219 lines, -5 lines 0 comments Download
A test/ios/gyptest-swift.py View 1 1 chunk +40 lines, -0 lines 0 comments Download
A test/ios/gyptest-swift-wmo.py View 1 1 chunk +40 lines, -0 lines 0 comments Download
A test/ios/swift-wmo/AppDelegate.h View 1 1 chunk +8 lines, -0 lines 0 comments Download
A test/ios/swift-wmo/AppDelegate.m View 1 1 chunk +41 lines, -0 lines 0 comments Download
A test/ios/swift-wmo/Info.plist View 1 1 chunk +43 lines, -0 lines 0 comments Download
A test/ios/swift-wmo/MySecondSwiftClass.swift View 1 1 chunk +4 lines, -0 lines 0 comments Download
A test/ios/swift-wmo/MySwiftClass.swift View 1 1 chunk +4 lines, -0 lines 0 comments Download
A test/ios/swift-wmo/main.m View 1 1 chunk +9 lines, -0 lines 0 comments Download
A test/ios/swift-wmo/test.gyp View 1 1 chunk +41 lines, -0 lines 0 comments Download
A test/ios/swift/AppDelegate.h View 1 chunk +8 lines, -0 lines 0 comments Download
A test/ios/swift/AppDelegate.m View 1 chunk +40 lines, -0 lines 0 comments Download
A test/ios/swift/Info.plist View 1 chunk +43 lines, -0 lines 0 comments Download
A test/ios/swift/MyObjcClass.h View 1 chunk +7 lines, -0 lines 0 comments Download
A test/ios/swift/MyObjcClass.m View 1 chunk +21 lines, -0 lines 0 comments Download
A test/ios/swift/MyObjcFrameworkClass.h View 1 chunk +4 lines, -0 lines 0 comments Download
A test/ios/swift/MyObjcFrameworkClass.m View 1 chunk +4 lines, -0 lines 0 comments Download
A test/ios/swift/MyObjcTest.m View 1 chunk +26 lines, -0 lines 0 comments Download
A test/ios/swift/MySecondSwiftClass.swift View 1 chunk +4 lines, -0 lines 0 comments Download
A test/ios/swift/MySwiftClass.swift View 1 chunk +16 lines, -0 lines 0 comments Download
A test/ios/swift/MySwiftFrameworkClass.swift View 1 chunk +4 lines, -0 lines 0 comments Download
A test/ios/swift/MySwiftTest.swift View 1 1 chunk +13 lines, -0 lines 0 comments Download
A + test/ios/swift/TestInfo.plist View 1 chunk +3 lines, -9 lines 0 comments Download
A test/ios/swift/main.m View 1 chunk +9 lines, -0 lines 0 comments Download
A test/ios/swift/swift_framework.h View 1 chunk +1 line, -0 lines 0 comments Download
A test/ios/swift/swift_ios-Bridging-Header.h View 1 chunk +3 lines, -0 lines 0 comments Download
A test/ios/swift/test.gyp View 1 chunk +101 lines, -0 lines 0 comments Download
A + test/mac/gyptest-swift.py View 1 2 1 chunk +6 lines, -6 lines 0 comments Download
A test/mac/swift/AppDelegate.h View 1 chunk +5 lines, -0 lines 0 comments Download
A test/mac/swift/AppDelegate.m View 1 chunk +27 lines, -0 lines 0 comments Download
A + test/mac/swift/Info.plist View 2 chunks +4 lines, -6 lines 0 comments Download
A test/mac/swift/MyObjcClass.h View 1 chunk +7 lines, -0 lines 0 comments Download
A test/mac/swift/MyObjcClass.m View 1 chunk +7 lines, -0 lines 0 comments Download
A test/mac/swift/MyObjcTest.m View 1 chunk +16 lines, -0 lines 0 comments Download
A test/mac/swift/MySecondSwiftClass.swift View 1 chunk +4 lines, -0 lines 0 comments Download
A test/mac/swift/MySwiftClass.swift View 1 chunk +11 lines, -0 lines 0 comments Download
A test/mac/swift/MySwiftTest.swift View 1 chunk +13 lines, -0 lines 0 comments Download
A + test/mac/swift/TestInfo.plist View 1 chunk +3 lines, -9 lines 0 comments Download
A test/mac/swift/main.m View 1 chunk +5 lines, -0 lines 0 comments Download
A test/mac/swift/swift_mac-Bridging-Header.h View 1 chunk +3 lines, -0 lines 0 comments Download
A test/mac/swift/test.gyp View 1 chunk +69 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
efimovmichael
5 years, 6 months ago (2015-06-08 11:41:31 UTC) #1
Dirk Pranke
thakis@ is a better reviewer for this than I am.
5 years, 6 months ago (2015-06-09 02:07:40 UTC) #3
Nico
Super cool! I'm on vacation tomorrow (Wednesday) and Friday. I probably won't have time to ...
5 years, 6 months ago (2015-06-10 01:09:18 UTC) #4
efimovmichael
https://codereview.chromium.org/1160773005/diff/1/pylib/gyp/xcode_emulation.py File pylib/gyp/xcode_emulation.py (right): https://codereview.chromium.org/1160773005/diff/1/pylib/gyp/xcode_emulation.py#newcode490 pylib/gyp/xcode_emulation.py:490: cflags.append('-Xclang -fmodule-implementation-of -Xclang ' + On 2015/06/10 01:09:18, Nico ...
5 years, 5 months ago (2015-07-22 14:46:05 UTC) #6
efimovmichael
5 years, 3 months ago (2015-09-08 09:22:26 UTC) #7
On 2015/07/22 14:46:05, efimovmichael wrote:
> https://codereview.chromium.org/1160773005/diff/1/pylib/gyp/xcode_emulation.py
> File pylib/gyp/xcode_emulation.py (right):
> 
>
https://codereview.chromium.org/1160773005/diff/1/pylib/gyp/xcode_emulation.p...
> pylib/gyp/xcode_emulation.py:490: cflags.append('-Xclang
> -fmodule-implementation-of -Xclang ' +
> On 2015/06/10 01:09:18, Nico (vacation Wed Jun 10) wrote:
> > -Xclang flags are considered clang-internal flags and aren't stable. Isn't
> there
> > some driver-level flag for this? If not, should there be one? (Does xcode do
> > this?)
> 
> I tried to copy all flags, which Xcode uses itself(6.3.1 version).
> Some of them are probably internal to Xcode's version of clang and don't have
> any documentation.
> But I tested all flags used in this patch on both versions of clang: Xcode's
> version and Chromium version(last one) and everything looks fine.
> As for this flag, I found a reference to it's name in some public
correspondence
> here:
>
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140721/111034.html
> I think, this flag is an alternative to the -fmodule-name flag from the
official
> clang documentation. 
> Both of them deny importing module within Objective-C sources of this
module(and
> they probably do something else). As I see it, Apple's clang team were unhappy
> with implementation of '-fmodule-name' and added their own. I tried using both
> of them, they work on both Xcode's clang and Chromium's clang).
> However, these flags produce different errors(when I'm trying to write @import
> to my module inside my module), so they actually trigger different logic
inside
> clang.
> In short, we can replace '-fmodule-implementation-of' with '-fmodule-name' but
> we'll move away from Xcode's original compilation process.

review please

Powered by Google App Engine
This is Rietveld 408576698