mirror of
https://github.com/openharmony/third_party_cmake.git
synced 2026-07-21 16:25:22 -04:00
NAG: Fix using Fortran modules from their output directory
The NAG Fortran compiler's `-mdir` flag sets the module output
directory but does not add the directory to the search path for using
modules. This is inconsistent with other compilers like the GNU Fortran
compiler's `-J` flag that does both. In order to make these consistent,
add the module output directory with a `-I` flag on the NAG Fortran
compiler so that it will be searched when using modules too.
We already do this for the XL Fortran compiler since commit 6a203e081b
(XL: Fix using Fortran modules from their output directory, 2020-02-28,
v3.18.0-rc1~640^2~1).
This commit is contained in:
@@ -31,6 +31,7 @@ endif()
|
||||
set(CMAKE_Fortran_SUBMODULE_SEP ".")
|
||||
set(CMAKE_Fortran_SUBMODULE_EXT ".sub")
|
||||
set(CMAKE_Fortran_MODDIR_FLAG "-mdir ")
|
||||
set(CMAKE_Fortran_MODDIR_INCLUDE_FLAG "-I") # -mdir does not affect search path
|
||||
set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-PIC")
|
||||
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed")
|
||||
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free")
|
||||
|
||||
Reference in New Issue
Block a user