<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/121210>121210</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Cmake fails to configure with Xcode generator
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
SteveMontgomery
</td>
</tr>
</table>
<pre>
I checked out the main branch. Cmake fails when configuring for the Xcode generator when clang is included in the project list. The same command with the Ninja generator works fine, i.e.
$ cmake --fresh -G "Xcode" -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_PROJECTS=clang ../llvm
fails
$ cmake --fresh -G "Xcode" -DCMAKE_BUILD_TYPE=Debug ../llvm
configures OK
$ cmake --fresh -G "Ninja" -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_PROJECTS=clang ../llvm
configures OK
When configuring for Xcode with clang enabled, there are multiple error messages of the form:
CMake Error at /Users/Steve/Development/llvm-project/clang/cmake/modules/AddClang.cmake:119 (target_compile_definitions):
Cannot specify compile definitions for target "obj.clangBasic" which is not
built by this project.
Call Stack (most recent call first):
/Users/Steve/Development/llvm-project/clang/lib/Basic/CMakeLists.txt:57 (add_clang_library)
I tracked this down to commit 09fa2f012fccb6f1cf2f540856e67f55431da800 which certainly seems relevant given it's modified clang/cmake/modules/AddClang.cmake.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVMuO4zYQ_Br60rAgUZIfBx08thVs1rO7yMzmcTIosilxhiINkrLjvw9Ie5JBsgiCJIABH7pZXaqqbua96g1iQ-oHUu9mbAqDdc1TwDM-WhN6O6K7zjorrs0H4APyVxRgpwBhQBiZMtA5ZviQwXZkrwiSKe3hMqABbo1U_eSU6UFal178zK1A6NGgY8G6e6NmpgflQRmuJ4EClEndJ2dfkAfQyocMngcEz0YEbseRGQEXFYbU90mZF_Ye1bpXD1IZJHQLKsOM5Jv4oxX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