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<value>` and `-J <value>` 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.
This commit is contained in:
Tarun Prabhu
2025-11-24 12:09:28 -07:00
committed by Brad King
parent 6672acb8b4
commit db6b82ae54

View File

@@ -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")