Merge topic 'vs-platforms'

ef4394d VS: Add ArchitectureId to VS 8 and 9 generators
4fec681 VS: Map /ENTRY linker option to EntryPointSymbol
be49129 VS: Add more TargetMachine option values
807fca4 VS: Convert PlatformName member to a virtual method
This commit is contained in:
Brad King 2010-08-31 14:37:16 -04:00 committed by CMake Topic Stage
commit 3913bff986
11 changed files with 45 additions and 24 deletions

View File

@ -40,7 +40,7 @@ void cmGlobalVisualStudio10Generator::WriteSLNHeader(std::ostream& fout)
cmLocalGenerator *cmGlobalVisualStudio10Generator::CreateLocalGenerator()
{
cmLocalVisualStudio10Generator* lg = new cmLocalVisualStudio10Generator;
lg->SetPlatformName(this->PlatformName.c_str());
lg->SetPlatformName(this->GetPlatformName());
lg->SetGlobalGenerator(this);
return lg;
}

View File

@ -16,7 +16,6 @@
//----------------------------------------------------------------------------
cmGlobalVisualStudio10Win64Generator::cmGlobalVisualStudio10Win64Generator()
{
this->PlatformName = "x64";
}
//----------------------------------------------------------------------------

View File

@ -27,6 +27,8 @@ public:
return cmGlobalVisualStudio10Win64Generator::GetActualName();}
static const char* GetActualName() {return "Visual Studio 10 Win64";}
virtual const char* GetPlatformName() const {return "x64";}
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;

View File

@ -21,7 +21,7 @@ cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator()
{
this->FindMakeProgramFile = "CMakeVS8FindMake.cmake";
this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms";
this->PlatformName = "Win32";
this->ArchitectureId = "X86";
}
//----------------------------------------------------------------------------
@ -30,6 +30,7 @@ cmLocalGenerator *cmGlobalVisualStudio8Generator::CreateLocalGenerator()
{
cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator;
lg->SetVersion8();
lg->SetPlatformName(this->GetPlatformName());
lg->SetExtraFlagTable(this->GetExtraFlagTableVS8());
lg->SetGlobalGenerator(this);
return lg;
@ -55,8 +56,8 @@ void cmGlobalVisualStudio8Generator
//----------------------------------------------------------------------------
void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf)
{
mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "X86");
mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "X86");
mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", this->ArchitectureId);
mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", this->ArchitectureId);
mf->AddDefinition("MSVC80", "1");
}
@ -252,8 +253,8 @@ cmGlobalVisualStudio8Generator
for(std::vector<std::string>::iterator i = this->Configurations.begin();
i != this->Configurations.end(); ++i)
{
fout << "\t\t" << *i << "|" << this->PlatformName << " = " << *i << "|"
<< this->PlatformName << "\n";
fout << "\t\t" << *i << "|" << this->GetPlatformName() << " = " << *i << "|"
<< this->GetPlatformName() << "\n";
}
fout << "\tEndGlobalSection\n";
}
@ -269,13 +270,13 @@ cmGlobalVisualStudio8Generator
i != this->Configurations.end(); ++i)
{
fout << "\t\t{" << guid << "}." << *i
<< "|" << this->PlatformName << ".ActiveCfg = "
<< *i << "|" << this->PlatformName << "\n";
<< "|" << this->GetPlatformName() << ".ActiveCfg = "
<< *i << "|" << this->GetPlatformName() << "\n";
if(partOfDefaultBuild)
{
fout << "\t\t{" << guid << "}." << *i
<< "|" << this->PlatformName << ".Build.0 = "
<< *i << "|" << this->PlatformName << "\n";
<< "|" << this->GetPlatformName() << ".Build.0 = "
<< *i << "|" << this->GetPlatformName() << "\n";
}
}
}

View File

@ -32,14 +32,14 @@ public:
return cmGlobalVisualStudio8Generator::GetActualName();}
static const char* GetActualName() {return "Visual Studio 8 2005";}
virtual const char* GetPlatformName() const {return "Win32";}
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;
///! Create a local generator appropriate to this Global Generator
virtual cmLocalGenerator *CreateLocalGenerator();
std::string const& GetPlatformName() const { return this->PlatformName; }
/**
* Override Configure and Generate to add the build-system check
* target.
@ -78,6 +78,7 @@ protected:
virtual void WriteProjectConfigurations(std::ostream& fout,
const char* name,
bool partOfDefaultBuild);
std::string PlatformName; // Win32 or x64
const char* ArchitectureId;
};
#endif

View File

@ -19,7 +19,7 @@
cmGlobalVisualStudio8Win64Generator::cmGlobalVisualStudio8Win64Generator()
{
this->PlatformName = "x64";
this->ArchitectureId = "x64";
}
///! Create a local generator appropriate to this Global Generator
@ -27,7 +27,7 @@ cmLocalGenerator *cmGlobalVisualStudio8Win64Generator::CreateLocalGenerator()
{
cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator;
lg->SetVersion8();
lg->SetPlatformName(this->PlatformName.c_str());
lg->SetPlatformName(this->GetPlatformName());
lg->SetExtraFlagTable(this->GetExtraFlagTableVS8());
lg->SetGlobalGenerator(this);
return lg;
@ -48,6 +48,4 @@ void cmGlobalVisualStudio8Win64Generator
{
this->cmGlobalVisualStudio8Generator::AddPlatformDefinitions(mf);
mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE");
mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "x64");
mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "x64");
}

View File

@ -33,6 +33,8 @@ public:
return cmGlobalVisualStudio8Win64Generator::GetActualName();}
static const char* GetActualName() {return "Visual Studio 8 2005 Win64";}
virtual const char* GetPlatformName() const {return "x64";}
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;

View File

@ -25,8 +25,8 @@ cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator()
//----------------------------------------------------------------------------
void cmGlobalVisualStudio9Generator::AddPlatformDefinitions(cmMakefile* mf)
{
mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "X86");
mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "X86");
mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", this->ArchitectureId);
mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", this->ArchitectureId);
mf->AddDefinition("MSVC90", "1");
}
@ -42,6 +42,7 @@ cmLocalGenerator *cmGlobalVisualStudio9Generator::CreateLocalGenerator()
{
cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator;
lg->SetVersion9();
lg->SetPlatformName(this->GetPlatformName());
lg->SetExtraFlagTable(this->GetExtraFlagTableVS8());
lg->SetGlobalGenerator(this);
return lg;

View File

@ -16,7 +16,7 @@
cmGlobalVisualStudio9Win64Generator::cmGlobalVisualStudio9Win64Generator()
{
this->PlatformName = "x64";
this->ArchitectureId = "x64";
}
///! Create a local generator appropriate to this Global Generator
@ -24,7 +24,7 @@ cmLocalGenerator *cmGlobalVisualStudio9Win64Generator::CreateLocalGenerator()
{
cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator;
lg->SetVersion9();
lg->SetPlatformName(this->PlatformName.c_str());
lg->SetPlatformName(this->GetPlatformName());
lg->SetExtraFlagTable(this->GetExtraFlagTableVS8());
lg->SetGlobalGenerator(this);
return lg;
@ -45,6 +45,4 @@ void cmGlobalVisualStudio9Win64Generator
{
cmGlobalVisualStudio9Generator::AddPlatformDefinitions(mf);
mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE");
mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "x64");
mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "x64");
}

View File

@ -33,6 +33,8 @@ public:
return cmGlobalVisualStudio9Win64Generator::GetActualName();}
static const char* GetActualName() {return "Visual Studio 9 2008 Win64";}
virtual const char* GetPlatformName() const {return "x64";}
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;

View File

@ -466,6 +466,8 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] =
{"GenerateManifest", "MANIFEST", "enable manifest generation", "TRUE", 0},
{"LinkIncremental", "INCREMENTAL:NO", "link incremental", "1", 0},
{"LinkIncremental", "INCREMENTAL:YES", "link incremental", "2", 0},
{"EntryPointSymbol", "ENTRY:", "sets the starting address", "",
cmVS7FlagTable::UserValue},
{"IgnoreDefaultLibraryNames", "NODEFAULTLIB:", "default libs to ignore", "",
cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
{"IgnoreAllDefaultLibraries", "NODEFAULTLIB", "ignore all default libs",
@ -480,6 +482,21 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] =
{"OptimizeReferences", "OPT:REF", "Eliminate unreferenced data", "2", 0},
{"TargetMachine", "MACHINE:I386", "Machine x86", "1", 0},
{"TargetMachine", "MACHINE:X86", "Machine x86", "1", 0},
{"TargetMachine", "MACHINE:AM33", "Machine AM33", "2", 0},
{"TargetMachine", "MACHINE:ARM", "Machine ARM", "3", 0},
{"TargetMachine", "MACHINE:EBC", "Machine EBC", "4", 0},
{"TargetMachine", "MACHINE:IA64", "Machine IA64", "5", 0},
{"TargetMachine", "MACHINE:M32R", "Machine M32R", "6", 0},
{"TargetMachine", "MACHINE:MIPS", "Machine MIPS", "7", 0},
{"TargetMachine", "MACHINE:MIPS16", "Machine MIPS16", "8", 0},
{"TargetMachine", "MACHINE:MIPSFPU)", "Machine MIPSFPU", "9", 0},
{"TargetMachine", "MACHINE:MIPSFPU16", "Machine MIPSFPU16", "10", 0},
{"TargetMachine", "MACHINE:MIPSR41XX", "Machine MIPSR41XX", "11", 0},
{"TargetMachine", "MACHINE:SH3", "Machine SH3", "12", 0},
{"TargetMachine", "MACHINE:SH3DSP", "Machine SH3DSP", "13", 0},
{"TargetMachine", "MACHINE:SH4", "Machine SH4", "14", 0},
{"TargetMachine", "MACHINE:SH5", "Machine SH5", "15", 0},
{"TargetMachine", "MACHINE:THUMB", "Machine THUMB", "16", 0},
{"TargetMachine", "MACHINE:X64", "Machine x64", "17", 0},
{"ModuleDefinitionFile", "DEF:", "add an export def file", "",
cmVS7FlagTable::UserValue},