diff options
author | Zack Galbreath <zack.galbreath@kitware.com> | 2014-11-14 18:47:00 (GMT) |
---|---|---|
committer | Zack Galbreath <zack.galbreath@kitware.com> | 2014-11-21 18:32:45 (GMT) |
commit | 17b0fe03052bcbc45293139d408e008371f1ffe0 (patch) | |
tree | a360e27dc2eb5c3467779b5ac5ae2ff3f2a98848 /Source/cmLocalVisualStudio7Generator.cxx | |
parent | 0700f2ef1918a4bf9de197e1b25f1e2a00eb82f5 (diff) | |
download | CMake-17b0fe03052bcbc45293139d408e008371f1ffe0.zip CMake-17b0fe03052bcbc45293139d408e008371f1ffe0.tar.gz CMake-17b0fe03052bcbc45293139d408e008371f1ffe0.tar.bz2 |
Fix incremental linking setting for Fortran + VS
This commit fixes a bug where it was impossible to specify
/INCREMENTAL to Fortran projects built with Visual Studio.
The problem was due to the fact that .vfproj files expect
the value of this flag to be "linkIncremental{No,Yes},
whereas .vcproj files expect this value to be 0, 1, or 2.
The implementation of this fix adds a new data structure for
Visual Studio linker flags specific to Fortran. This can
easily be extended in the future if more such discrepencies
between C/C++ and Fortran linking are discovered.
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index eb45423..0e66764 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -592,6 +592,15 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] = {0,0,0,0,0} }; +cmVS7FlagTable cmLocalVisualStudio7GeneratorFortranLinkFlagTable[] = +{ + {"LinkIncremental", "INCREMENTAL:NO", "link incremental", + "linkIncrementalNo", 0}, + {"LinkIncremental", "INCREMENTAL:YES", "link incremental", + "linkIncrementalYes", 0}, + {0,0,0,0,0} +}; + //---------------------------------------------------------------------------- // Helper class to write build event <Tool .../> elements. class cmLocalVisualStudio7Generator::EventWriter @@ -1056,8 +1065,13 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout, extraLinkOptions += " "; extraLinkOptions += targetLinkFlags; } - Options linkOptions(this, Options::Linker, - cmLocalVisualStudio7GeneratorLinkFlagTable); + Options linkOptions(this, Options::Linker); + if(this->FortranProject) + { + linkOptions.AddTable(cmLocalVisualStudio7GeneratorFortranLinkFlagTable); + } + linkOptions.AddTable(cmLocalVisualStudio7GeneratorLinkFlagTable); + linkOptions.Parse(extraLinkOptions.c_str()); if(!this->ModuleDefinitionFile.empty()) { |