Skip to content

Commit 0a4be78

Browse files
authored
[flang] Move LLVM_ENABLE_RUNTIMES definition above uses (#138136)
1 parent deae5ee commit 0a4be78

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

llvm/CMakeLists.txt

+17-17
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,23 @@ foreach(proj ${LLVM_ENABLE_PROJECTS})
138138
endif()
139139
endforeach()
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+
141158
if ("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 ()
191208
endif ()
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.
211211
option(LIBC_GPU_BUILD "Enable the 'libc' project targeting the GPU" OFF)
212212
if(LIBC_GPU_BUILD)

0 commit comments

Comments
 (0)