Commit 7a12835
Paul Bowen-Huggett
Fix a cmake error when using the Xcode generator.
I’m seeing a series of errors when trying to run the cmake configure
step when the cmake generator is set to Xcode. All is well if I use
the Ninja or Unix Makefile generators. Messages are all of the form:
CMake Error at
…llvm-project/clang/cmake/modules/AddClang.cmake:120 (target_compile_definitions):
Cannot specify compile definitions for target "obj.clangBasic" which
is not built by this project.
Call Stack (most recent call first):
…llvm-project/clang/lib/Basic/CMakeLists.txt:57 (add_clang_library)
The remaining errors mention targets obj.clangAPINotes, obj.clangLex,
obj.clangParse, and so on.
The regression appears to have been introduced by commit
09fa2f0 (Oct 14 2024) which added the code in this area.
My proposed solution is simply to add a test to ensure that the obj.x
target exists before setting its compile definitions. There is
precedent doing just this in both clang/cmake/modules/AddClang.cmake
and clang/lib/support/CMakeLists.txt as well as in the “MSVC AND NOT
CLANG_LINK_CLANG_DYLIB” path immediately above the offending line.
I’ve also made a couple of grammatical tweaks in the comments
surrounding this code.1 parent 97ff961 commit 7a12835
1 file changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
117 | | - | |
118 | | - | |
| 118 | + | |
| 119 | + | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
| |||
0 commit comments