mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[PR #50] [MERGED] Add ability to build pod as a framework #409
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/libxlsxwriter#409
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jmcnamara/libxlsxwriter/pull/50
Author: @lrossi
Created: 6/2/2016
Status: ✅ Merged
Merged: 6/2/2016
Merged by: @jmcnamara
Base:
master← Head:update-cocoapods📝 Commits (1)
d4a7444Add ability to build pod as a framework📊 Changes
3 files changed (+40 additions, -0 deletions)
View changed files
➕
cocoapods/libxlsxwriter-umbrella.h(+28 -0)➕
cocoapods/libxlsxwriter.modulemap(+7 -0)📝
libxlsxwriter.podspec(+5 -0)📄 Description
TL;DR
With the final version of CocoaPods 1.0.0 out, I made another attempt and was able to add support for
use_frameworks!without the need for introducing an additional subspec. I now recommend merging this PR over my previous one. However, I’m leaving the old PR open as well until the whole discussion on this topic is closed.The nitty-gritty
I started out as in the previous PR (#44), thus since a straight build of the current pod with
use_frameworks!leads to:I added
in the podspec.
Then a new problem arose:
In my previous PR, I solved this error by moving the
xlsxwriter.hheader inside of thexlsxwriterdirectory. However, what I had missed out is that it is possible to specify a custom module map file in the podspec. According to the Clang documentation, a module mapTaking inspiration from the module map file that is usually generated by CocoaPods, I wrote a (slightly) custom one as follows:
The second line inside the block fixes the compilation error. Hooray!
Oh wait, we’re not done yet
A new compilation error arose since the
xlsxwriterframework is now missing the umbrella header, because CocoaPods doesn’t automacally generate it when specifying a custom module map file. Actually, this is not a bug but a feature. I then took the umbrella header previously generated by CocoaPods and manually added it to the repo. Since I didn’t want to pollute theincludedirectory that is shared with other platforms, I created a newcocoapodsdirectory with the module map and umbrella header files inside and added these lines to the podspec:The bottom line
The obvious disadvantage of this solution is that whenever a new header file is added to the project, we need to remember to manually include it in the umbrella header. However, I still tend to favor this solution over my previous one since (1) it seems cleaner and (2) the pod can now be added to a project with a simple
in the Podfile, regardless of whether the
use_frameworks!directive is specified or not.What do you think?
P.S. If you want to quickly try it out, I made another branch in my example repo that uses this PR to import the pod.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.