[libc-commits] [compiler-rt] [libc] [libcxx] [libcxxabi] [libunwind] [llvm] [openmp] [runtimes][CMake] Move Fortran support code from flang-rt (PR #171610)
Petr Hosek via libc-commits
libc-commits at lists.llvm.org
Thu Apr 9 01:04:00 PDT 2026
================
@@ -0,0 +1,238 @@
+# Check whether the build environment supports building Fortran modules
+# flang-rt and openmp are the only runtimes that contain Fortran modules.
+
+
+# Whether building modules for Fortran is supported in the current build environment.
+# Also initializes RUNTIMES_ENABLE_FLANG_MODULES.
+# This is currently not intended to be a user-configuration but derived from CMAKE_Fortran_COMPILER.
+set(RUNTIMES_ENABLE_FORTRAN OFF)
+
+# List of targets that must be built by artifacts that compile using the Fortran compiler
+set(RUNTIMES_FORTRAN_BUILD_DEPS "")
+
+# Currently we hardcode which runtimes make use of Fortran
+set(request_fortran_support OFF)
+if ("flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES OR "openmp" IN_LIST LLVM_ENABLE_RUNTIMES)
+ set(request_fortran_support ON)
+endif ()
----------------
petrhosek wrote:
Could we move this check to `runtimes/CMakeLists.txt` to avoid including this file altogether when not needed and also avoid the extra nesting in this file?
https://github.com/llvm/llvm-project/pull/171610
More information about the libc-commits
mailing list