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/cmVisualStudioGeneratorOptions.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/cmVisualStudioGeneratorOptions.cxx')
-rw-r--r-- | Source/cmVisualStudioGeneratorOptions.cxx | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index cdc8879..00386f6 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -28,6 +28,26 @@ std::string cmVisualStudioGeneratorOptionsEscapeForXML(std::string ret) cmVisualStudioGeneratorOptions ::cmVisualStudioGeneratorOptions(cmLocalVisualStudioGenerator* lg, Tool tool, + cmVisualStudio10TargetGenerator* g): + cmIDEOptions(), + LocalGenerator(lg), Version(lg->GetVersion()), CurrentTool(tool), + TargetGenerator(g) +{ + // Preprocessor definitions are not allowed for linker tools. + this->AllowDefine = (tool != Linker); + + // Slash options are allowed for VS. + this->AllowSlash = true; + + this->FortranRuntimeDebug = false; + this->FortranRuntimeDLL = false; + this->FortranRuntimeMT = false; +} + +//---------------------------------------------------------------------------- +cmVisualStudioGeneratorOptions +::cmVisualStudioGeneratorOptions(cmLocalVisualStudioGenerator* lg, + Tool tool, cmVS7FlagTable const* table, cmVS7FlagTable const* extraTable, cmVisualStudio10TargetGenerator* g): @@ -36,9 +56,8 @@ cmVisualStudioGeneratorOptions TargetGenerator(g) { // Store the given flag tables. - cmIDEFlagTable const** ft = this->FlagTable; - if(table) { *ft++ = table; } - if(extraTable) { *ft++ = extraTable; } + this->AddTable(table); + this->AddTable(extraTable); // Preprocessor definitions are not allowed for linker tools. this->AllowDefine = (tool != Linker); @@ -52,6 +71,22 @@ cmVisualStudioGeneratorOptions } //---------------------------------------------------------------------------- +void cmVisualStudioGeneratorOptions::AddTable(cmVS7FlagTable const* table) +{ + if(table) + { + for(int i=0; i < FlagTableCount; ++i) + { + if (!this->FlagTable[i]) + { + this->FlagTable[i] = table; + break; + } + } + } +} + +//---------------------------------------------------------------------------- void cmVisualStudioGeneratorOptions::FixExceptionHandlingDefault() { // Exception handling is on by default because the platform file has |