[CMake] xcode generator's use of explicitFileType vs lastKnownFileType

Eric Wing ewmailing at gmail.com
Fri Dec 19 02:20:33 EST 2014


On 12/18/14, Radu Margarint <raduma at raduma.com> wrote:
> Greetings,
>
> I hope I'm asking this in correct place. I have recently been running
> into some issues using the xcode project files generated though cmake,
> and I have traced them down to PBXFileReference nodes using
> explicitFileType attributes (vs lastKnownFileType).
>
> The projects generated are some fairly vanilla mac static libs +
> console apps, with a file count of ~500ish, about a dozen targets in
> all. Nothing I would consider complex. However, attempting to open the
> generated project files in xcode results in xcode hanging for about
> 3-4 minutes parsing the project file, at open time or whenever it
> decides it should reparse it. (Sampling it indicates that it's
> spending it's time calling [PBXFileReference
> _getEffectiveFileType:fileProperties:] over and over and over).
> Eventually it finishes and wakes up.
>
> Though a lot of trial and error manually mucking with the generated
> project files, I've traced the slowdown to the use of
> "explicitFileType" on the file reference nodes. A simple replace to
> "lastKnownFileType" fixes the issue and xcode opens the project
> instantly.
>
> I'm wondering if anyone has seen this before, and if there are any
> fixes recommended. (The obvious one being I can patch my cmake
> generator locally to use the desired attribute, though I'm hoping that
> maybe there are some known root causes and better fixes). (FWIW, the
> slow down occurs on both Xcode 5.x and 6.x, on a couple of machines
> across Yosemite and Mavericks).
>
> Thanks
> --radu
> --
>

I have experienced the extremely long and 100% CPU utilization of
Xcode indexing. And in Xcode 5, there seemed to be conditions where it
would completely hang and you have to force kill Xcode. And it seems
to be random luck on whether it freezes again; certain computers seem
to be more susceptible to freezing here. (So far Xcode 6 doesn't seem
to need killing, but the CPU taxing is still painful.) And this
problem I'm hitting is for relatively small projects, not necessarily
large ones.

I had not been able to look into this problem and don't know any of
the backend details, so I'm happy to hear you found something. This is
one of my most worrisome concerns about the Xcode generator right now.
(And moving forward, I see it unlikely that the Makefile generator
will be sufficient for real Mac & iOS development and we need a much
better Xcode generator.)

Another thing I just came across is that the internal $SRCROOT
directory maps to the root CMakeList.txt directory instead of where
the Xcode project resides. Right now, I think this is confusing the
OSX entitlements file feature which is causing me pain.


I don't have any recommendations, except whatever you find/fix is
probably good and well needed.

Thanks,
Eric
-- 
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/


More information about the CMake mailing list