summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/XL-Fortran.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-02-28 15:22:23 (GMT)
committerBrad King <brad.king@kitware.com>2020-02-28 15:37:11 (GMT)
commit210b0b99a96a37cb19de7e703c12f99a4a925926 (patch)
tree42535cdd045049f9ac04b86d791fa309c08260cc /Modules/Compiler/XL-Fortran.cmake
parent2a9cf889178dfc202ec84f1fece8a68594cc3566 (diff)
downloadCMake-210b0b99a96a37cb19de7e703c12f99a4a925926.zip
CMake-210b0b99a96a37cb19de7e703c12f99a4a925926.tar.gz
CMake-210b0b99a96a37cb19de7e703c12f99a4a925926.tar.bz2
XL: Fix using Fortran modules from their output directory
The XL Fortran compiler's `-qmoddir=` 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 XL Fortran compiler so that it will be searched when using modules too. This fixes our `FortranModules` test's coverage of submodules on Ninja + XL. That test places module files in a subdirectory that with Ninja is not the current working directory when the compiler runs. Fixes: #20400
Diffstat (limited to 'Modules/Compiler/XL-Fortran.cmake')
-rw-r--r--Modules/Compiler/XL-Fortran.cmake1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/Compiler/XL-Fortran.cmake b/Modules/Compiler/XL-Fortran.cmake
index 1683dff..e01ec8e 100644
--- a/Modules/Compiler/XL-Fortran.cmake
+++ b/Modules/Compiler/XL-Fortran.cmake
@@ -8,6 +8,7 @@ set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-qfixed") # [=<right_margin>]
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-qfree") # [=f90|ibm]
set(CMAKE_Fortran_MODDIR_FLAG "-qmoddir=")
+set(CMAKE_Fortran_MODDIR_INCLUDE_FLAG "-I") # -qmoddir= does not affect search path
set(CMAKE_Fortran_DEFINE_FLAG "-WF,-D")