You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[llvm][cmake] Error when a runtime is in LLVM_ENABLE_PROJECTS and LLVM_ENABLE_RUNTIMES (#109791)
The documentation tells you not to do this:
https://llvm.org/docs/CMake.html#llvm-related-variables
But until now we did not enforce it.
```
$ cmake ../llvm-project/llvm/ -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="pstl" -DLLVM_ENABLE_RUNTIMES="libcxx;pstl"
```
```
CMake Error at CMakeLists.txt:166 (message):
Runtime project "pstl" found in LLVM_ENABLE_PROJECTS and
LLVM_ENABLE_RUNTIMES. It must only appear in one of them and that one
should almost always be LLVM_ENABLE_RUNTIMES.
```
Copy file name to clipboardExpand all lines: llvm/CMakeLists.txt
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -161,6 +161,12 @@ foreach(proj IN LISTS LLVM_ENABLE_RUNTIMES)
161
161
endif()
162
162
endforeach()
163
163
164
+
foreach(projINLISTSLLVM_ENABLE_RUNTIMES)
165
+
if ("${proj}"IN_LISTLLVM_ENABLE_PROJECTS)
166
+
message(FATAL_ERROR"Runtime project \"${proj}\" found in LLVM_ENABLE_PROJECTS and LLVM_ENABLE_RUNTIMES. It must only appear in one of them and that one should almost always be LLVM_ENABLE_RUNTIMES.")
167
+
endif()
168
+
endforeach()
169
+
164
170
# Set a shorthand option to enable the GPU build of the 'libc' project.
165
171
option(LIBC_GPU_BUILD"Enable the 'libc' project targeting the GPU"OFF)
0 commit comments