Search code examples
iosxcodecarthage

Carthage dependency build with custom flags


I'm debugging a memory corruption issue in an iOS application using Carthage for dependency management.

The problem is most likely related to a 3rd party dependency. I've rebuilt the dependency with -configuration Debug but that didn't give me any more data.

What I'd really like to do is compile it with -fsanitize-address which will hopefully pinpoint the exact moment things start going wrong. Unfortunately I don't see how to do this with Carthage. Is this possible?


Solution

  • You can modify the dependency's source code and project in Carthage/Checkouts. Just open it up in Xcode and tweak away to change anything you like. Then do carthage build to update the frameworks in your project.

    Just be aware that the next time you do a Carthage update it will blow away any of the mods you've made. Carthage/checkouts only contains exported versions of the dependencies. Not git repos.