5

I'm trying to implement a certain pre-compilation effect on objective-C code (explained here). I've managed to get a custom compiler in place in Xcode 5 following these helpful instructions. However my passthru attempt to clang results in an error:

My custom compiler's executable:

#!/bin/bash
clang "$@"

Error message:

While building module 'UIKit' imported from /Users/Club15CC/Google Drive/Code/Frogger/Frogger/Frogger-Prefix.pch:14:
...
In file included from  
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:13:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIDevice.h:33:1: 
error: use of empty enum
};
^
/Users/Club15CC/Google Drive/Code/Frogger/Frogger/Frogger-Prefix.pch:14:13: fatal error: could not build module 'UIKit'
    #import <UIKit/UIKit.h>
     ~~~~~~~^
2 errors generated.
Command /usr/bin/frogger failed with exit code 1

Note the executable is called frogger and the test Xcode project Frogger.

It builds fine with the default compiler. Does the enum error imply some flag isn't being passed through? Does bash have a limit to the size of $@? The compiler invoking string is rather long and perhaps is being truncated?

Thanks for any help...

---- UPDATE ----

It seems as though it's passing the wrong "minimum version" flag to the custom compiler: The normal LLVM compiler has this flag: -mios-simulator-version-min=7.0 while my custom one is getting this flag: -mmacosx-version-min=10.6 - which is the cause of the UIDevice error. The correct flags are handled inside of /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Specifications/Native Build System.xcspec and the equivalent one for iOS as opposed to simulator. It seems somehow my custom compilers not picking up these specs. I'm in over my head here!

4

0 回答 0