diff options
author | Neil Carlson <neil.n.carlson@gmail.com> | 2020-01-15 19:04:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-01-15 19:12:22 (GMT) |
commit | f7f60ddcf90a1a4c41b1a0f931726ee0527949e3 (patch) | |
tree | 2e0b4849c92ab1932a56d3c9067f85231679bf3a | |
parent | 512ab500f06d6c645985cc8014c5e6291b9a059f (diff) | |
download | CMake-f7f60ddcf90a1a4c41b1a0f931726ee0527949e3.zip CMake-f7f60ddcf90a1a4c41b1a0f931726ee0527949e3.tar.gz CMake-f7f60ddcf90a1a4c41b1a0f931726ee0527949e3.tar.bz2 |
Fortran: Add support for NAG Fortran submodules
They use a `.sub` extension.
Fixes: #20220
-rw-r--r-- | Modules/Compiler/NAG-Fortran.cmake | 2 | ||||
-rw-r--r-- | Source/cmDependsFortran.cxx | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/Modules/Compiler/NAG-Fortran.cmake b/Modules/Compiler/NAG-Fortran.cmake index 9973feb..edc56fd 100644 --- a/Modules/Compiler/NAG-Fortran.cmake +++ b/Modules/Compiler/NAG-Fortran.cmake @@ -28,6 +28,8 @@ if(NOT CMAKE_Fortran_COMPILER_WORKS AND NOT CMAKE_Fortran_COMPILER_FORCED) endif() endif() +set(CMAKE_Fortran_SUBMODULE_SEP ".") +set(CMAKE_Fortran_SUBMODULE_EXT ".sub") set(CMAKE_Fortran_MODDIR_FLAG "-mdir ") set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-PIC") set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed") diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index ee43587..3692202 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -33,6 +33,8 @@ static void cmFortranModuleAppendUpperLower(std::string const& mod, ext_len = 4; } else if (cmHasLiteralSuffix(mod, ".smod")) { ext_len = 5; + } else if (cmHasLiteralSuffix(mod, ".sub")) { + ext_len = 4; } std::string const& name = mod.substr(0, mod.size() - ext_len); std::string const& ext = mod.substr(mod.size() - ext_len); @@ -284,7 +286,8 @@ void cmDependsFortran::MatchRemoteModules(std::istream& fin, if (doing_provides) { std::string mod = line; if (!cmHasLiteralSuffix(mod, ".mod") && - !cmHasLiteralSuffix(mod, ".smod")) { + !cmHasLiteralSuffix(mod, ".smod") && + !cmHasLiteralSuffix(mod, ".sub")) { // Support fortran.internal files left by older versions of CMake. // They do not include the ".mod" extension. mod += ".mod"; @@ -470,7 +473,8 @@ bool cmDependsFortran::CopyModule(const std::vector<std::string>& args) if (args.size() >= 5) { compilerId = args[4]; } - if (!cmHasLiteralSuffix(mod, ".mod") && !cmHasLiteralSuffix(mod, ".smod")) { + if (!cmHasLiteralSuffix(mod, ".mod") && !cmHasLiteralSuffix(mod, ".smod") && + !cmHasLiteralSuffix(mod, ".sub")) { // Support depend.make files left by older versions of CMake. // They do not include the ".mod" extension. mod += ".mod"; |