I have an Objective C project in XCode. When building, XCode precompiles my prefix PCH file twice. The first time, it uses the arguments -x objective-c-header
, and it works fine. The second time, it uses -x c-header
, and it fails (due to the file containing Objective C code).
I have another project that's set up the same, but it builds fine. (The PCH is only precompiled once, with Objective C.) I compared the build settings for the two projects side-by-side, and nothing relevant differed. I compared the build settings for the targets side-by-side, and again, no relevant differences.
I tried cleaning all targets and rebuilding, but no luck. I tried restarting XCode, but no luck. I grepped my project folder for c-header
, but it only showed up in the build logs.
What could be causing this?