@@ -138,6 +138,23 @@ foreach(proj ${LLVM_ENABLE_PROJECTS})
138138 endif ()
139139endforeach ()
140140
141+ # Select the runtimes to build
142+ #
143+ # As we migrate runtimes to using the bootstrapping build, the set of default runtimes
144+ # should grow as we remove those runtimes from LLVM_ENABLE_PROJECTS above.
145+ set (LLVM_DEFAULT_RUNTIMES "libcxx;libcxxabi;libunwind" )
146+ set (LLVM_SUPPORTED_RUNTIMES "libc;libunwind;libcxxabi;pstl;libcxx;compiler-rt;openmp;llvm-libgcc;offload;flang-rt" )
147+ set (LLVM_ENABLE_RUNTIMES "" CACHE STRING
148+ "Semicolon-separated list of runtimes to build, or \" all\" (${LLVM_DEFAULT_RUNTIMES} ). Supported runtimes are ${LLVM_SUPPORTED_RUNTIMES} ." )
149+ if (LLVM_ENABLE_RUNTIMES STREQUAL "all" )
150+ set (LLVM_ENABLE_RUNTIMES ${LLVM_DEFAULT_RUNTIMES} )
151+ endif ()
152+ foreach (proj IN LISTS LLVM_ENABLE_RUNTIMES)
153+ if (NOT "${proj} " IN_LIST LLVM_SUPPORTED_RUNTIMES)
154+ message (FATAL_ERROR "Runtime \" ${proj} \" is not a supported runtime. Supported runtimes are: ${LLVM_SUPPORTED_RUNTIMES} " )
155+ endif ()
156+ endforeach ()
157+
141158if ("flang" IN_LIST LLVM_ENABLE_PROJECTS)
142159 if (NOT "mlir" IN_LIST LLVM_ENABLE_PROJECTS)
143160 message (STATUS "Enabling MLIR as a dependency to flang" )
@@ -190,23 +207,6 @@ if ("flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
190207 endif ()
191208endif ()
192209
193- # Select the runtimes to build
194- #
195- # As we migrate runtimes to using the bootstrapping build, the set of default runtimes
196- # should grow as we remove those runtimes from LLVM_ENABLE_PROJECTS above.
197- set (LLVM_DEFAULT_RUNTIMES "libcxx;libcxxabi;libunwind" )
198- set (LLVM_SUPPORTED_RUNTIMES "libc;libunwind;libcxxabi;pstl;libcxx;compiler-rt;openmp;llvm-libgcc;offload;flang-rt" )
199- set (LLVM_ENABLE_RUNTIMES "" CACHE STRING
200- "Semicolon-separated list of runtimes to build, or \" all\" (${LLVM_DEFAULT_RUNTIMES} ). Supported runtimes are ${LLVM_SUPPORTED_RUNTIMES} ." )
201- if (LLVM_ENABLE_RUNTIMES STREQUAL "all" )
202- set (LLVM_ENABLE_RUNTIMES ${LLVM_DEFAULT_RUNTIMES} )
203- endif ()
204- foreach (proj IN LISTS LLVM_ENABLE_RUNTIMES)
205- if (NOT "${proj} " IN_LIST LLVM_SUPPORTED_RUNTIMES)
206- message (FATAL_ERROR "Runtime \" ${proj} \" is not a supported runtime. Supported runtimes are: ${LLVM_SUPPORTED_RUNTIMES} " )
207- endif ()
208- endforeach ()
209-
210210# Set a shorthand option to enable the GPU build of the 'libc' project.
211211option (LIBC_GPU_BUILD "Enable the 'libc' project targeting the GPU" OFF )
212212if (LIBC_GPU_BUILD)
0 commit comments