diff options
author | Brad King <brad.king@kitware.com> | 2010-11-09 22:54:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-11-09 22:54:40 (GMT) |
commit | 22aec406e6df44dcde0fa98e694455306febeaf1 (patch) | |
tree | 0a52c9527685274259716cb8fee042ddd54b2427 /Source/cmVisualStudioGeneratorOptions.cxx | |
parent | 3d79e7d58ca0ebb63ffaba4ed16c1ea8c6bcf91d (diff) | |
download | CMake-22aec406e6df44dcde0fa98e694455306febeaf1.zip CMake-22aec406e6df44dcde0fa98e694455306febeaf1.tar.gz CMake-22aec406e6df44dcde0fa98e694455306febeaf1.tar.bz2 |
Set Intel .vfproj RuntimeLibrary attribute
Look for the "/threads", "/libs:dll", and "/dbglibs" flags and convert
them to the proper RuntimeLibrary attribute value in the IDE. This is
a 3-to-1 flag mapping and such needs special handling in the parser.
Diffstat (limited to 'Source/cmVisualStudioGeneratorOptions.cxx')
-rw-r--r-- | Source/cmVisualStudioGeneratorOptions.cxx | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index 972af95..f1bad9c 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -45,6 +45,10 @@ cmVisualStudioGeneratorOptions // Slash options are allowed for VS. this->AllowSlash = true; + + this->FortranRuntimeDebug = false; + this->FortranRuntimeDLL = false; + this->FortranRuntimeMT = false; } //---------------------------------------------------------------------------- @@ -133,8 +137,55 @@ void cmVisualStudioGeneratorOptions::Parse(const char* flags) } //---------------------------------------------------------------------------- +void cmVisualStudioGeneratorOptions::ParseFinish() +{ + if(this->CurrentTool == FortranCompiler) + { + // "RuntimeLibrary" attribute values: + // "rtMultiThreaded", "0", /threads /libs:static + // "rtMultiThreadedDLL", "2", /threads /libs:dll + // "rtMultiThreadedDebug", "1", /threads /dbglibs /libs:static + // "rtMultiThreadedDebugDLL", "3", /threads /dbglibs /libs:dll + // These seem unimplemented by the IDE: + // "rtSingleThreaded", "4", /libs:static + // "rtSingleThreadedDLL", "10", /libs:dll + // "rtSingleThreadedDebug", "5", /dbglibs /libs:static + // "rtSingleThreadedDebugDLL", "11", /dbglibs /libs:dll + std::string rl = "rtMultiThreaded"; + rl += this->FortranRuntimeDebug? "Debug" : ""; + rl += this->FortranRuntimeDLL? "DLL" : ""; + this->FlagMap["RuntimeLibrary"] = rl; + } +} + +//---------------------------------------------------------------------------- void cmVisualStudioGeneratorOptions::StoreUnknownFlag(const char* flag) { + // Look for Intel Fortran flags that do not map well in the flag table. + if(this->CurrentTool == FortranCompiler) + { + if(strcmp(flag, "/dbglibs") == 0) + { + this->FortranRuntimeDebug = true; + return; + } + if(strcmp(flag, "/threads") == 0) + { + this->FortranRuntimeMT = true; + return; + } + if(strcmp(flag, "/libs:dll") == 0) + { + this->FortranRuntimeDLL = true; + return; + } + if(strcmp(flag, "/libs:static") == 0) + { + this->FortranRuntimeDLL = false; + return; + } + } + // This option is not known. Store it in the output flags. this->FlagString += " "; this->FlagString += |