[llvm] [runtimes][cmake] Probe Fortran intrinsic modules for the target triple (PR #211137)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 07:31:17 PDT 2026


Meinersbur wrote:

Nice for your AI to check that quickly, but the issue is that `CMAKE_Fortran_COMPILE_OPTIONS_TARGET` is set at a different scope when CMake does it in `CMakeFortranCompiler.cmake` vs. us doing it manually in directory scope. `try_compile` seems to only consider the former global scope. 

> The manual set(CMAKE_Fortran_COMPILE_OPTIONS_TARGET "--target=") is not the cause. On 3.25 the flag is missing from try_compile whether or not it is set manually, and in the same configure the main build does get it:

The root issue is still that we cannot override `CMAKE_Fortran_COMPILE_OPTIONS_TARGET` the way CMake does.

Beween CMake 3.24 and CMake 3.27 the var `CMAKE_Fortran_COMPILER_FORCED` is not set even though CMAKE_Fortran_COMPILE_OPTIONS_TARGET does not work for the above reason.

I would suggest to enable the `execute_process` workaround version of CMake >= 3.24 and < 3.28 as well.

We should avoid passing `--target` multiple times in `try_compile`: By CMake and this PR.

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


More information about the llvm-commits mailing list