File tree Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -57,9 +57,21 @@ if(LLVM_LIBC_FULL_BUILD OR LIBC_GPU_BUILD OR LIBC_GPU_ARCHITECTURES)
57
57
endif ()
58
58
endif ()
59
59
60
+ set (NEED_LIBC_HDRGEN FALSE )
61
+ if (NOT LLVM_RUNTIMES_BUILD )
62
+ if ("libc" IN_LIST LLVM_ENABLE_RUNTIMES )
63
+ set (NEED_LIBC_HDRGEN TRUE )
64
+ else ()
65
+ foreach (_name ${LLVM_RUNTIME_TARGETS} )
66
+ if ("libc" IN_LIST RUNTIMES_${_name}_LLVM_ENABLE_RUNTIMES )
67
+ set (NEED_LIBC_HDRGEN TRUE )
68
+ break ()
69
+ endif ()
70
+ endforeach ()
71
+ endif ()
72
+ endif ()
60
73
option (LIBC_HDRGEN_ONLY "Only build the 'libc-hdrgen' executable" OFF )
61
- if (("libc" IN_LIST LLVM_ENABLE_RUNTIMES AND NOT LLVM_RUNTIMES_BUILD ) OR
62
- LIBC_HDRGEN_ONLY )
74
+ if (LIBC_HDRGEN_ONLY OR NEED_LIBC_HDRGEN )
63
75
# When libc is build as part of the runtimes/bootstrap build's CMake run, we
64
76
# only need to build the host tools to build the libc. So, we just do enough
65
77
# to build libc-hdrgen and return.
@@ -70,6 +82,7 @@ if(("libc" IN_LIST LLVM_ENABLE_RUNTIMES AND NOT LLVM_RUNTIMES_BUILD) OR
70
82
endif ()
71
83
return ()
72
84
endif ()
85
+ unset (NEED_LIBC_HDRGEN )
73
86
74
87
option (LIBC_CMAKE_VERBOSE_LOGGING
75
88
"Log details warnings and notifications during CMake configuration." OFF )
Original file line number Diff line number Diff line change @@ -168,7 +168,18 @@ foreach(proj IN LISTS LLVM_ENABLE_RUNTIMES)
168
168
endif ()
169
169
endforeach ()
170
170
171
- if ("libc" IN_LIST LLVM_ENABLE_RUNTIMES )
171
+ set (NEED_LIBC_HDRGEN FALSE )
172
+ if ("libc" IN_LIST LLVM_ENABLE_RUNTIMES )
173
+ set (NEED_LIBC_HDRGEN TRUE )
174
+ else ()
175
+ foreach (_name ${LLVM_RUNTIME_TARGETS} )
176
+ if ("libc" IN_LIST RUNTIMES_${_name}_LLVM_ENABLE_RUNTIMES )
177
+ set (NEED_LIBC_HDRGEN TRUE )
178
+ break ()
179
+ endif ()
180
+ endforeach ()
181
+ endif ()
182
+ if (NEED_LIBC_HDRGEN )
172
183
# To build the libc runtime, we need to be able to build few libc build
173
184
# tools from the "libc" project. So, we add it to the list of enabled
174
185
# projects.
@@ -177,6 +188,7 @@ if ("libc" IN_LIST LLVM_ENABLE_RUNTIMES)
177
188
list (APPEND LLVM_ENABLE_PROJECTS "libc" )
178
189
endif ()
179
190
endif ()
191
+ unset (NEED_LIBC_HDRGEN )
180
192
181
193
# LLVM_ENABLE_PROJECTS_USED is `ON` if the user has ever used the
182
194
# `LLVM_ENABLE_PROJECTS` CMake cache variable. This exists for
You can’t perform that action at this time.
0 commit comments