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] Do not emit error on libc's use of project + runtime build (#110038)
Summary:
The `libc` project automatically adds `libc` to the projects list if
it's in the runtimes list. This then causes it to enter the projects
directory to bootstrap a handful of utilities, This usage conflicts
with a new error message with effectively stopped us from doing this.
This patch weakens the error message to permit this single case.
Copy file name to clipboardExpand all lines: llvm/CMakeLists.txt
+10-6Lines changed: 10 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -161,12 +161,6 @@ 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
-
170
164
# Set a shorthand option to enable the GPU build of the 'libc' project.
171
165
option(LIBC_GPU_BUILD"Enable the 'libc' project targeting the GPU"OFF)
172
166
if(LIBC_GPU_BUILD)
@@ -204,6 +198,16 @@ if(NEED_LIBC_HDRGEN)
204
198
list(APPENDLLVM_ENABLE_PROJECTS"libc")
205
199
endif()
206
200
endif()
201
+
202
+
foreach(projINLISTSLLVM_ENABLE_RUNTIMES)
203
+
if("${proj}"IN_LISTLLVM_ENABLE_PROJECTS)
204
+
# The 'libc' project bootstraps a few executables via the project build and
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.")
208
+
endif()
209
+
endif()
210
+
endforeach()
207
211
unset(NEED_LIBC_HDRGEN)
208
212
209
213
# LLVM_ENABLE_PROJECTS_USED is `ON` if the user has ever used the
0 commit comments