diff options
author | Brad King <brad.king@kitware.com> | 2016-09-19 19:36:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-20 12:48:41 (GMT) |
commit | 7b5f85677c8aa067a5fef1cc68f4d8c8600693fa (patch) | |
tree | 1f5d9a419980bb89df73afae0d44aba8c731b314 /Source/cmLocalCommonGenerator.cxx | |
parent | 1777570fe5eb194d930f6716865bc909269da57e (diff) | |
download | CMake-7b5f85677c8aa067a5fef1cc68f4d8c8600693fa.zip CMake-7b5f85677c8aa067a5fef1cc68f4d8c8600693fa.tar.gz CMake-7b5f85677c8aa067a5fef1cc68f4d8c8600693fa.tar.bz2 |
Fortran: Use module dir flag if needed for default module directory
Our buildsystem model says that the default Fortran module output
directory is the build tree directory corresponding to the source tree
`CMakeLists.txt` file adding the current target. Extend
`cmGeneratorTarget::GetFortranModuleDirectory` to allow generators to
pass in the compiler working directory. If the working directory does
not match the default Fortran module output directory then we need an
explicit module directory flag (e.g. `-J`) to tell the compiler to
put/use modules in the latter.
This does not affect the Makefile generator but will be useful for
future introduction of Fortran support to the Ninja generator.
Diffstat (limited to 'Source/cmLocalCommonGenerator.cxx')
-rw-r--r-- | Source/cmLocalCommonGenerator.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmLocalCommonGenerator.cxx b/Source/cmLocalCommonGenerator.cxx index 97323c9..b75ce62 100644 --- a/Source/cmLocalCommonGenerator.cxx +++ b/Source/cmLocalCommonGenerator.cxx @@ -54,7 +54,8 @@ std::string cmLocalCommonGenerator::GetTargetFortranFlags( } // Add a module output directory flag if necessary. - std::string mod_dir = target->GetFortranModuleDirectory(); + std::string mod_dir = + target->GetFortranModuleDirectory(this->WorkingDirectory); if (!mod_dir.empty()) { mod_dir = this->ConvertToOutputFormat( this->ConvertToRelativePath(this->WorkingDirectory, mod_dir), |