Skip to content

Commit 51dcd63

Browse files
committed
Move 'no runtime' warning to flang
1 parent cfbb2bb commit 51dcd63

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

flang/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,10 @@ else()
242242
include_directories(SYSTEM ${MLIR_TABLEGEN_OUTPUT_DIR})
243243
endif()
244244

245-
if (NOT "flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
246-
message(STATUS "Not building Flang-RT. For a usable Fortran toolchain, either add LLVM_ENABLE_RUNTIMES=flang-rt, or compile a standalone Flang-RT.")
245+
if (FLANG_STANDALONE_BUILD)
246+
message(STATUS "Not building Flang-RT. For a usable Fortran toolchain, compile a standalone Flang-RT.")
247+
elseif (NOT "flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
248+
message(STATUS "Not building Flang-RT. For a usable Fortran toolchain, either set FLANG_ENABLE_FLANG_RT=ON, add LLVM_ENABLE_RUNTIMES=flang-rt, or compile a standalone Flang-RT.")
247249
endif ()
248250

249251
set(FLANG_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH

llvm/CMakeLists.txt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,13 @@ foreach(proj IN LISTS LLVM_ENABLE_RUNTIMES)
187187
endif()
188188
endforeach()
189189

190-
option(FLANG_ENABLE_FLANG_RT "Implicitly add LLVM_ENABLE_RUNTIMES=flang-rt when compiling Flang" ON)
191190
if ("flang" IN_LIST LLVM_ENABLE_PROJECTS)
191+
option(FLANG_ENABLE_FLANG_RT "Implicitly add LLVM_ENABLE_RUNTIMES=flang-rt when compiling Flang" ON)
192192
if (NOT "flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
193-
message(STATUS "Enabling Flang-RT as a dependency of Flang"
194-
"Flang-RT is required for a fully working Flang toolchain."
195-
"If you intend to compile Flang-RT separately following the instructions at"
196-
"https://github.com/llvm/llvm-project/blob/main/flang-rt/README.md#standalone-runtimes-build"
197-
"you should use -DFLANG_ENABLE_FLANG_RT=OFF to not build Flang-RT as part of this build."
198-
)
199-
list(APPEND LLVM_ENABLE_RUNTIMES "flang-rt")
193+
if (FLANG_ENABLE_FLANG_RT)
194+
message(STATUS "Enabling Flang-RT as a dependency of Flang")
195+
list(APPEND LLVM_ENABLE_RUNTIMES "flang-rt")
196+
endf ()
200197
endif()
201198
endif ()
202199

0 commit comments

Comments
 (0)