Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Unnecessary script phase in build #40

MrNoodle opened this Issue · 4 comments

2 participants


I noticed that JSON.h has conditional compilation based on a hardcoded "1" which is replaced via a shell script build phase. Maybe I'm missing something here, but couldn't you just have it be #ifdef SOMETHING and add -DSOMETHING to the CFLAGS in the build settings for the appropriate targets? Seems less error-prone (especially since I'm seeing another issue concerning the script).


I agree that this is a HORRIBLE HORRIBLE HACK. But I couldn't figure out another way that satisfied all these:

  • Don't force users to put -DSOMETHING in their CFLAGS
  • Works on iPhone / Mac, both when:
    • copied into your app
    • using the static lib / framework

I'm not sure if I follow. The CFLAGS would be set in the targets to build the frameworks/library. Just use #ifndef SOMETHING and if the CFLAGS aren't set (i.e. user copies the files into their own project), then it works fine.


I couldn't make it work... Care to make a patch? :)


Hmm, trying it out I see where it breaks down. Though, whenever I copy third party code into my projects, I do tend to stick them into their own dir so the imports would work fine. Not sure if that is something you want to require though.

@stig stig closed this issue from a commit
@stig Introduce an indirection and some slight of hand into the header incl…
…udes so we can use the same top-level header name for iOS/Mac libraries and when copying the sources into your project. Fixes #40
@stig stig closed this in 8cabcf4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.