Mix pods with different deployment targets #1376

Closed
rivera-ernesto opened this Issue Sep 18, 2013 · 4 comments

Projects

None yet

3 participants

@rivera-ernesto
Contributor

I tried to find an answer but it seems that it is not possible in the current Cocopods.

My project has iOS 4.3 as its deployment target.

All my pod libraries support 4.3 but one, which I also want to include, taking care off course not to use its classes on iOS 4.3 devices.

I tried using the target option on my Podfile as follows:

platform :ios, '4.3'
pod 'NBUCore'

target :MyApp do
    platform :ios, '5.0'
    pod 'PEPhotoCropEditor'
end

Which creates the usual libPods.a with NBUCore and a new libPods-MyApp.a with PEPhotoCropEditor, both correctly linked to MyApp.

The problems are:

  1. There are two .xcconfig files, Pods.xcconfig and Pods-MyApp.xcconfig but only one of them gets activated by Cocoapods and thus link fails because each has an incomplete OTHER_LDFLAGS.
  2. The "Copy Pods Resources" scripts for both Pods and Pods-MyApp would also need to be merged, or a better solution would be to call both scripts from the build step:
"${SRCROOT}/Pods/Pods-resources.sh"
"${SRCROOT}/Pods/Pods-MyApp-resources.sh" 

I have tried with both target :test, :exclusive => true and false, and I could manually modify those files or add $(inherited) flags. But then maybe Cocoapods should take care of that.

@fabiopelosin
Member

#1241 is the correct solution for this.

@rivera-ernesto
Contributor

Which solution @irrationalfab? Manually modifying and maintaining a custom podspec?

@ryancoughlin

@irrationalfab As @rivera-ernesto Which is the best to do? I am running into the same issue with my current project.

Curious, any plans to make this do able in future releases?

@rivera-ernesto
Contributor

I'm doing as described on the issue and manually solving problems 1) and 2), which wasn't hard to do.

On the other hand #1241 suggests directly modifying (and thus maintaining) podspecs which kinda defeats the purpose of centralized podspecs repositories. Also it is not a "solution" but a workaround as stated there.

As for plans, I think there's none despite being a very important missing feature. Maybe at least the issue should be reopened to discuss it.

Edit:

#1241 is open to solve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment