marcoarment / BugshotKit

iOS in-app bug reporting for developers and testers, with annotated screenshots and the console log.
MIT License
1.36k stars 138 forks source link

Added a static library build process for conditional linking #9

Closed michaeltyson closed 10 years ago

michaeltyson commented 10 years ago

I've added an Xcode project which will build a universal static library (based on this template), so one can use a conditional linker flag to only link to BugshotKit from Debug/Ad-Hoc builds. That way, no BugshotKit symbols will be present in an App Store build. Instructions added to the Readme.

bobspryn commented 10 years ago

Alright having trouble with building this as an implicit target dependency instead of dragging it into my project.

  1. I added the project to my workspace.
  2. I added the binary to the libraries in build phases
  3. I added the headers to the Header Search Paths with "$(BUILD_ROOT)/../IntermediateBuildFilesPath/UninstalledProducts/BugShotKit"
  4. I added the -lBushotKit flag to my debug and adhoc builds

That all works fine when debugging, but when trying to actually archive it I get the error ld: library not found for -lBugshotKit

Any ideas?

michaeltyson commented 10 years ago

Hmm, I seem to remember that it should be more automatic than that - I don't think you need to touch the search paths or add linker flags. I think you add the lib as a build dependency, then add it to the "Link Binary with Libraries" phase by tapping the "+" button and selecting it from the "Workspace" group in the dialog that appears. Something like that.

bobspryn commented 10 years ago

You generally need to add the headers to the search paths somehow. That's what I typically do for libraries like ReactiveCocoa, RestKit, etc. For some reason it just can't find that 'library'. Tried all sorts of combinations. Finally went to a cocoa pod. :(

michaeltyson commented 10 years ago

Bugger - Oh well, whatever works I guess!