Yoga Podspec: Export YGNode and YGStyle headers #997

Closed
empyrical wants to merge 1 commits from add-fabric-dependencies into master
empyrical commented 2020-04-09 20:47:53 -07:00 (Migrated from github.com)

This pull request adds YGNode.h and YGStyle.h to the headers exported by Yoga's podspec. They are required by the new Fabric architecture of React Native.

The modulemap and its umbrella header automatically generated by Cocoapods adds all exported headers to the modulemap. Having YGNode and YGStyle exported through here has problems, because they are only available in environments that have C++ available, and will produce errors otherwise.

This pull request fences off the contents of those headers in an #ifdef __cplusplus block, so they will not cause errors when imported into environments where C++ isn't available.

I had considered adding a custom modulemap to the podspec as part of this pull request, but this way seems the least "invasive", and this way you are able to add and remove exported headers in the podspec without needing to worry about updating the umbrella header at the same time.

This pull request adds `YGNode.h` and `YGStyle.h` to the headers exported by Yoga's podspec. They are required by the new Fabric architecture of React Native. The modulemap and its umbrella header automatically generated by Cocoapods adds all exported headers to the `modulemap`. Having YGNode and YGStyle exported through here has problems, because they are only available in environments that have C++ available, and will produce errors otherwise. This pull request fences off the contents of those headers in an `#ifdef __cplusplus` block, so they will not cause errors when imported into environments where C++ isn't available. I had considered adding a custom modulemap to the podspec as part of this pull request, but this way seems the least "invasive", and this way you are able to add and remove exported headers in the podspec without needing to worry about updating the umbrella header at the same time.
facebook-github-bot (Migrated from github.com) reviewed 2020-04-10 10:27:32 -07:00
facebook-github-bot (Migrated from github.com) left a comment

@mdvacca has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@mdvacca has imported this pull request. If you are a Facebook employee, you can view this diff [on Phabricator](https://our.internmc.facebook.com/intern/diff/D20966075/).
facebook-github-bot commented 2020-04-14 17:38:29 -07:00 (Migrated from github.com)

@mdvacca merged this pull request in facebook/yoga@9b96a5362a.

@mdvacca merged this pull request in facebook/yoga@9b96a5362a873935c50b444aa271927257c2f984.

Pull request closed

Sign in to join this conversation.
No description provided.