Merge topic 'vs-intel-RuntimeLibrary'

22aec40 Set Intel .vfproj RuntimeLibrary attribute
3d79e7d Fix Intel .vfproj SubSystem attribute values
This commit is contained in:
David Cole 2010-11-16 14:46:12 -05:00 committed by CMake Topic Stage
commit b61c5be3d7
3 changed files with 61 additions and 2 deletions

View File

@ -669,6 +669,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
targetOptions.FixExceptionHandlingDefault();
targetOptions.Parse(flags.c_str());
targetOptions.Parse(defineFlags.c_str());
targetOptions.ParseFinish();
targetOptions.AddDefines
(this->Makefile->GetProperty("COMPILE_DEFINITIONS"));
targetOptions.AddDefines(target.GetProperty("COMPILE_DEFINITIONS"));
@ -1098,11 +1099,13 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
}
if ( target.GetPropertyAsBool("WIN32_EXECUTABLE") )
{
fout << "\t\t\t\tSubSystem=\"2\"\n";
fout << "\t\t\t\tSubSystem=\""
<< (this->FortranProject? "subSystemWindows" : "2") << "\"\n";
}
else
{
fout << "\t\t\t\tSubSystem=\"1\"\n";
fout << "\t\t\t\tSubSystem=\""
<< (this->FortranProject? "subSystemConsole" : "1") << "\"\n";
}
std::string stackVar = "CMAKE_";
stackVar += linkLanguage;

View File

@ -45,6 +45,10 @@ cmVisualStudioGeneratorOptions
// Slash options are allowed for VS.
this->AllowSlash = true;
this->FortranRuntimeDebug = false;
this->FortranRuntimeDLL = false;
this->FortranRuntimeMT = false;
}
//----------------------------------------------------------------------------
@ -132,9 +136,56 @@ 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 +=

View File

@ -39,6 +39,7 @@ public:
// Store options from command line flags.
void Parse(const char* flags);
void ParseFinish();
// Fix the ExceptionHandling option to default to off.
void FixExceptionHandlingDefault();
@ -67,6 +68,10 @@ private:
Tool CurrentTool;
cmVisualStudio10TargetGenerator* TargetGenerator;
bool FortranRuntimeDebug;
bool FortranRuntimeDLL;
bool FortranRuntimeMT;
virtual void StoreUnknownFlag(const char* flag);
};