Skip to content

Fix Build Warnings for SPM with Xcode 12.5 Beta 2#1661

Closed
joesus wants to merge 1 commit intofacebook:masterfrom
joesus:export-D26609865
Closed

Fix Build Warnings for SPM with Xcode 12.5 Beta 2#1661
joesus wants to merge 1 commit intofacebook:masterfrom
joesus:export-D26609865

Conversation

@joesus
Copy link
Copy Markdown
Contributor

@joesus joesus commented Feb 23, 2021

Summary:
Swift Package Manager (SPM) by convention will treat any files in the include directory of a target as public. Therefore they need to be present in the umbrella header. Typically this is the header with the target name, ex: FBSDKCoreKit.h.

For the target FBSDKCoreKit_Basics this means removing the internal header FBSDKUserDataStore+Internal.h since internal headers should not go in the include directory. Some internal methods are used by the meta indexer class but these were already declared in a private extension. Long term we will want to make these methods public but for now it makes sense to avoid adding them to the public interface.

For the target FBSDKCoreKit we have two types that are only compiled for tvOS. Since we already have them compilation-gated inline, it is not necessary to exclude them from compilation in the umbrella header. (It would be better to do this but it is not strictly necessary and this fixes the warning)

Differential Revision: D26609865

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D26609865

Summary:
Pull Request resolved: facebook#1661

Swift Package Manager (SPM) by convention will treat any files in the `include` directory of a target as public. Therefore they need to be present in the umbrella header. Typically this is the header with the target name, ex: `FBSDKCoreKit.h`.

For the target `FBSDKCoreKit_Basics` this means removing the internal header `FBSDKUserDataStore+Internal.h` since internal headers should not go in the `include` directory. Some internal methods are used by the meta indexer class but these were already declared in a private extension. Long term we will want to make these methods public but for now it makes sense to avoid adding them to the public interface.

For the target `FBSDKCoreKit` we have two types that are only compiled for tvOS. Since we already have them compilation-gated inline, it is not necessary to exclude them from compilation in the umbrella header. It would be better to do this but it is not strictly necessary and this fixes the warning. The part I really don't like about this fix is that it forces us to make those headers public in the Xcode project for targets that they really shouldn't be public for.

Differential Revision: D26609865

fbshipit-source-id: 6712ab9e5eb73beb7ae43164cb23b82323244740
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D26609865

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 46e385c.

@joesus joesus deleted the export-D26609865 branch April 28, 2021 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants