[llvm] [flang-rt][build] Add support for building flang-rt as a standalone project (PR #168321)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 06:30:51 PST 2025


https://github.com/Meinersbur requested changes to this pull request.

I cannot reproduce a problem with the current runtimes-default ("standalone") build. Some tasks such as amending CMAKE_MODULE_PATH is already appended by the top-level runtimes/CMakeLists.txt script, as well as `cmake_minimum_required` and `include(CheckCXXCompilerFlag)`. `IN_LIST` -> `list(FIND ...)` seems equivalent. `CMAKE_Fortran_COMPILER_FORCED` is, when it is what I think it is, deprecated in CMake and should not be used.

`.gitignore` is something global and should handled in https://github.com/llvm/llvm-project/blob/main/.gitignore, not per-project.

Although your script says `-S $ROOTDIR/runtimes`, it is missing `-DLLVM_ENABLE_RUNTIMES=flang-rt` mentioned in the instruction and therefore will not compile any runtime. I assume you using `flang-rt/CMakeLists` as top-level CMake file. You even explicitly skipped over the big error message that tells you how to do it correctly by adding `-DLLVM_RUNTIMES_BUILD=ON`.

https://github.com/llvm/llvm-project/pull/168321


More information about the llvm-commits mailing list