From db6b82ae5420b865e22d0a701c8be827bd0d2d84 Mon Sep 17 00:00:00 2001 From: Tarun Prabhu Date: Mon, 24 Nov 2025 12:09:28 -0700 Subject: LLVMFlang-Fortran: Use -J instead of -module-dir In flang, both -J and -module-dir support both joined and separate values. For the -J option, these are of the form `-J` and `-J ` respectively. Once https://github.com/llvm/llvm-project/pull/168748 is committed, -module-dir will only work with a separate value. Setting CMAKE_Fortran_MODDIR_FLAG to -J ensures that both joined and separate styles will continue to work after that change is made. As far as behavior is concerned, both -J and -module-dir are aliases. --- Modules/Compiler/LLVMFlang-Fortran.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Compiler/LLVMFlang-Fortran.cmake b/Modules/Compiler/LLVMFlang-Fortran.cmake index 0a432a9..8b9456e 100644 --- a/Modules/Compiler/LLVMFlang-Fortran.cmake +++ b/Modules/Compiler/LLVMFlang-Fortran.cmake @@ -7,7 +7,7 @@ set(CMAKE_Fortran_PREPROCESS_SOURCE set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-ffixed-form") set(CMAKE_Fortran_FORMAT_FREE_FLAG "-ffree-form") -set(CMAKE_Fortran_MODDIR_FLAG "-module-dir") +set(CMAKE_Fortran_MODDIR_FLAG "-J") set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "-cpp") set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "-nocpp") -- cgit v0.12