{"action":"created","issue":{"url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/4494","labels_url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/4494/labels{/name}","comments_url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/4494/comments","events_url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/4494/events","html_url":"https://github.com/CocoaPods/CocoaPods/issues/4494","id":115005662,"number":4494,"title":"Add a podspec parameter to suppress all implicit linking","user":{"login":"TGOS","id":8492950,"avatar_url":"https://avatars.githubusercontent.com/u/8492950?v=3","gravatar_id":"","url":"https://api.github.com/users/TGOS","html_url":"https://github.com/TGOS","followers_url":"https://api.github.com/users/TGOS/followers","following_url":"https://api.github.com/users/TGOS/following{/other_user}","gists_url":"https://api.github.com/users/TGOS/gists{/gist_id}","starred_url":"https://api.github.com/users/TGOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TGOS/subscriptions","organizations_url":"https://api.github.com/users/TGOS/orgs","repos_url":"https://api.github.com/users/TGOS/repos","events_url":"https://api.github.com/users/TGOS/events{/privacy}","received_events_url":"https://api.github.com/users/TGOS/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CocoaPods/CocoaPods/labels/t3:discussion","name":"t3:discussion","color":"E10288"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-11-04T09:09:20Z","updated_at":"2015-11-04T20:04:33Z","closed_at":null,"body":"This will not break compatibility with existing pods as they won't have this setting. If set, don't link against anything not specified in `s.frameworks`. So if someone adds that setting and doesn't specify Cocoa or UIKit explicitly, the pod is not liked against them. If an umbrella header is generated, it also won't import `Cocoa.h` or `UIKit.h` unless these frameworks are listed in `s.frameworks`."},"comment":{"url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/comments/153847599","html_url":"https://github.com/CocoaPods/CocoaPods/issues/4494#issuecomment-153847599","issue_url":"https://api.github.com/repos/CocoaPods/CocoaPods/issues/4494","id":153847599,"user":{"login":"TGOS","id":8492950,"avatar_url":"https://avatars.githubusercontent.com/u/8492950?v=3","gravatar_id":"","url":"https://api.github.com/users/TGOS","html_url":"https://github.com/TGOS","followers_url":"https://api.github.com/users/TGOS/followers","following_url":"https://api.github.com/users/TGOS/following{/other_user}","gists_url":"https://api.github.com/users/TGOS/gists{/gist_id}","starred_url":"https://api.github.com/users/TGOS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TGOS/subscriptions","organizations_url":"https://api.github.com/users/TGOS/orgs","repos_url":"https://api.github.com/users/TGOS/repos","events_url":"https://api.github.com/users/TGOS/events{/privacy}","received_events_url":"https://api.github.com/users/TGOS/received_events","type":"User","site_admin":false},"created_at":"2015-11-04T20:04:33Z","updated_at":"2015-11-04T20:04:33Z","body":"If Cocoapods is not explicitly linking Cocoa, then Samuel is wrong in #4481 when saying \"because those frameworks have always been linked, regardless of whether they have been explicitly specified\" as Cocoa has never been implicitly linked by Xcode and it still isn't. In very early versions of Xcode  it was linked because Apple put `-framework Cocoa` in the other linker flags for every new project. Later on Cocoa was just added to the \"Link with Frameworks\" build phase for every new project. And now it is usually linked because your code does `#import <Cocoa/Cocoa.h>` or `@import Cocoa;` and this causes the framework to automatically be liked.  But **none of that is implicit**, all of that happens explicitly. I named this issue *suppress all implicit linking* because of of the comments at #4481, which made me believe that Cocoapods is and always has been implicitly linking against Cocoa (and if that was the case, I was just looking for a totally backward compatible way to suppress that).\r\n\r\nIf you say that this linking is really only the result of `#import <Cocoa/Cocoa.h>` in the umbrella header (which was my problem to begin with), then we close this issue and I go back to #4481 to get rid of that import. This import is not required. CoreFoundation also has a `module.map` file and it has an umbrella header; take a look at it. Does it import Cocoa? Nope. Neither module support nor having an umbrella header make such an import necessary. Just removing it might break code that incorrectly relied upon that import, I'm totally with the developers here. However, that import is not even documented anywhere. This import is implicit and while implicit behavior itself isn't good to begin with, it's horrible when undocumented. So I wonder why it isn't possible to just suppress it. This issue was never really about the linking, it was actually about the import that (as you say) causes the linking.\r\n\r\nThe main problem with that import is, that when I import any of the framework headers into a `.c` file (plain C), then the umbrella header is imported instead. This is now expected behavior. If a framework has a module.map and also an umbrella header, then importing any header that is also imported by the umbrella header will import the umbrella header itself. This is usually nice and desired, but importing `Cocoa.h` into a plain C file will obviously not work as clang will not support any Obj-C constructs when you build a C file. I can protect all my Obj-C headers against such a fatal import (`#ifdef __OBJC__`) but that won't help if `Cocoa.h` is always imported, no matter what I do. There's a reason why Apple puts `#ifdef __OBJC__` into PCH files, so you can separated Obj-C imports from other imports (as the PCH file will also apply to C and C++ files)."}}