Some xcode schemes not appearing now in Xcode after cmake install (??)

Hi all

In order to get ready for the upcoming final 9.0 release code I have now switched to the ‘release/9.x’ branch that I pulled from github.

Unfortunately, after running cmake in the usual way, I found that many xcode schemes are missing on the resulting project.

Particularly, I added -DLLVM_ENABLE_PROJECTS=clang to the terminal command line. The logs correctly state that ‘clang project is enabled’. However, the ‘clang’ schema, and anything related with clang, is completely missing in the generated xcode project, so clang can’t be compiled.

This is the full command line that I used from the ‘llvm-project/build’ directory:


I know that the quick reply to my issue is: 'just use Ninja’, but I have already replied to that in the past. My work on LLVM+clang to create a compiler backend is essentially completed and the compiler is just a small part of a bigger project. I need to dedicate time now to something else. I am increasingly disappointed that something that worked fine, just keeps breaking every time I pull changes from the remote repo, by not being able to even compile it.

So, please, can anybody give me a clue on what can be wrong now with LLVM and xcode, and a possible workaround?

Thanks in advance.


Ok, I am replying to myself.

I saved the xcode xcuserdata folder in a safe place and trashed the entire ‘buid’ and ‘install’ directories (deleting cmakecache alone was not helpful). Ran again the cmake command. Copied the saved xcuserdata folder to its previous place, and boom, incidentally everything appeared just right on the newly created xcode project. It complied just fine, and as a bonus I’m now getting very fast incremental compiles.

So now the issue is solved but I don’t know why cmake messed up the previous xcode project when I ran it on the existing build directory.

I assume we are supposed to simply pull remote changes, merge them to our own working branch (which in my case contains an additional custom backend) and then simply run cmake on top of it, rather than recreating everything every time. Is this right, or am I missing some step?.



Hey Joan,

CMake’s support for generating Xcode schemes is fairly new (CMake 3.9 added it). If no schemes are generated by CMake (and LLVM’s build is not configured to generate them by default), Xcode should prompt when it first opens the project to auto-generate schemes for each target.

WRT this specific issue, I honestly have no idea what would cause it. Possibly a bug in CMake, possibly something that changed in LLVM.

All of these issues that you are having using Xcode are the byproduct of the lack of any contributors in LLVM who care about using Xcode as their build generator. You seem to care a lot about it. Our community would greatly benefit from having someone who cares willing to contribute patches and work on improving Xcode build support.