Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Custom build configurations in parent project #121

Closed
maikg opened this Issue Feb 14, 2012 · 20 comments

Comments

Projects
None yet
9 participants
Contributor

maikg commented Feb 14, 2012

I get an error when trying to build my application with custom build configurations.

ld: library not found for -lPods

As noted here, this can be fixed by also adding custom build configurations with the same names to the Pods project, but these changes get overwritten whenever I run pod install.

I noticed in that the Debug and Release build configurations are explicitly created for the Pods project. Would it be possible to also create any custom build configurations that are defined in the parent project during this step? Or as an alternative, define them in the Podfile?

I'd give this a go myself but I could really use some input.

Owner

alloy commented Feb 14, 2012

Good point. The problem is that, currently, we don’t do anything with the app project, except when asked to setup with pod install MyApp.xcodeproj. But that should change, also because of ticket #76.

If you want to start work on that, then please do go ahead :)

As an immediate workaround, you can add the configuration in a post_install hook in your Podfile with code similar to what you linked to.

Owner

alloy commented Feb 15, 2012

FYI, I’m currently using the workaround on a project:

post_install do |installer|
  settings = Xcodeproj::Project.send(:build_settings, Pod::Platform.new(:ios), :debug)
  configs  = installer.project.build_configurations
  configs.new('name' => 'Spec', 'buildSettings' => settings.merge('CONFIGURATION_BUILD_DIR' => '$(BUILD_DIR)/Debug$(EFFECTIVE_PLATFORM_NAME)'))
end
Owner

alloy commented Feb 15, 2012

Actually, that’s not complete, I’ll have to update that tomorrow.

Contributor

maikg commented Feb 17, 2012

Any update on the complete workaround?

@alloy please add the complete workaround, same problem here.
Thanks!

Owner

alloy commented Feb 18, 2012

Sorry guys, I’m currently sick and not able to think clear. If you want to look into this, then please check the exact diffs before adding the config by hand and afterwards, then use the above as a starting point.

Owner

alloy commented Mar 18, 2012

@maikg Did you get a chance to look into this?

Contributor

subdigital commented Apr 2, 2012

I got around this in my app by adding this build setting to my App Store configuration's Library Search Path setting:

$(BUILT_PRODUCTS_DIR)/../Release-iphoneos
Contributor

maikg commented Apr 2, 2012

@alloy Sorry for responding to this so late. I haven't got around to this yet. I think I prefer a shortcut that allows me to overwrite the default build configuration list in my Podfile, since parsing the parent xcodeproj would involve extending the Xcodeproj project extensively (if I'm not mistaken).

Would that solution work for you?

Owner

alloy commented Apr 2, 2012

@maikg The majority of the code needed to add the necessary configurations present in the user project is already in the multiple-platforms branch, but it’s currently still a bit rough, so let’s wait a bit more until I’m done with the current work.

@ghost ghost assigned alloy Apr 23, 2012

peelman commented May 1, 2012

Is there any thoughts on the workaround, since it looks like it might be a while before we see the ability to set this in the podfile?

I just spent the afternoon twiddling with this:

post_install do |installer|
  settings = Xcodeproj::Project.send(:build_settings, Pod::Platform.new(:ios), :debug)
  configs  = installer.project.build_configurations
  configs.new('name' => 'Spec', 'buildSettings' => settings.merge('CONFIGURATION_BUILD_DIR' => '$(BUILD_DIR)/Debug$(EFFECTIVE_PLATFORM_NAME)'))
end

to no avail. I could sometimes get a Staging configuration to show up, but it wouldn't be properly duplicated from the Debug configuration, as it gets when you do it manually in Xcode. I had all manner of scariness implemented over the course of the afternoon with little in the way of success. Curious if anybody else has any luck with it, or if @alloy was willing to throw me a bone :)

Contributor

siuying commented May 2, 2012

@peelman adding a library search path work for me

peelman commented May 2, 2012

Thanks, but that won't work for us. We want to be able to do automated builds; having to manually intervene with Xcode after running pod install kind of ruins that play.

Contributor

siuying commented May 2, 2012

@peelman you just have to add the library search path to your custom configuration once, later run of pod install should still be okay.

Owner

alloy commented May 2, 2012

@peelman See #215 for an example of what @siuying means.

peelman commented May 2, 2012

Doh, yeah I misread / misinterpreted that when i first read it. I just did some testing and it appears that works for us. Looking forward to being able to define configurations, but this appears to be a solid work around for the time being.

Owner

alloy commented May 6, 2012

Closed by 81d3550.

@alloy alloy closed this May 6, 2012

elsurudo commented Apr 3, 2013

Sorry to bring this up so late, but what can I do to an existing project with this problem? I upgraded to the newest version of cocoapods.... now what?

Owner

fabiopelosin commented Apr 3, 2013

@elsurudo This xcodeproj del directive of the Podfile should get you on the right track.

Please use the mailing list to ask questions about CP usage. The issues are reserved for features and bugs.

@jzapater jzapater pushed a commit to jzapater/CocoaPods that referenced this issue Sep 17, 2013

@SevInf SevInf Merge pull request #121 from lenniboy/master
Add podspec for NXOAuth2Client
0cad910

Any word on this?

@segiddins segiddins locked and limited conversation to collaborators Aug 19, 2014

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