Commit 163cc8bb authored by Brad King's avatar Brad King

VS: Convert WriteSLNHeader to non-virtual lookup table

parent 6d99406e
......@@ -488,16 +488,6 @@ std::string cmGlobalVisualStudio10Generator::SelectWindowsCEToolset() const
return "";
}
void cmGlobalVisualStudio10Generator::WriteSLNHeader(std::ostream& fout)
{
fout << "Microsoft Visual Studio Solution File, Format Version 11.00\n";
if (this->ExpressEdition) {
fout << "# Visual C++ Express 2010\n";
} else {
fout << "# Visual Studio 2010\n";
}
}
///! Create a local generator appropriate to this Global Generator
cmLocalGenerator* cmGlobalVisualStudio10Generator::CreateLocalGenerator(
cmMakefile* mf)
......
......@@ -43,7 +43,6 @@ public:
*/
void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
bool optional) override;
void WriteSLNHeader(std::ostream& fout) override;
bool IsCudaEnabled() const { return this->CudaEnabled; }
......
......@@ -188,16 +188,6 @@ bool cmGlobalVisualStudio11Generator::SelectWindowsStoreToolset(
toolset);
}
void cmGlobalVisualStudio11Generator::WriteSLNHeader(std::ostream& fout)
{
fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
if (this->ExpressEdition) {
fout << "# Visual Studio Express 2012 for Windows Desktop\n";
} else {
fout << "# Visual Studio 2012\n";
}
}
bool cmGlobalVisualStudio11Generator::UseFolderProperty() const
{
// Intentionally skip up to the top-level class implementation.
......
......@@ -26,8 +26,6 @@ public:
bool MatchesGeneratorName(const std::string& name) const override;
void WriteSLNHeader(std::ostream& fout) override;
protected:
bool InitializeWindowsPhone(cmMakefile* mf) override;
bool InitializeWindowsStore(cmMakefile* mf) override;
......
......@@ -186,16 +186,6 @@ bool cmGlobalVisualStudio12Generator::SelectWindowsStoreToolset(
toolset);
}
void cmGlobalVisualStudio12Generator::WriteSLNHeader(std::ostream& fout)
{
fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
if (this->ExpressEdition) {
fout << "# Visual Studio Express 2013 for Windows Desktop\n";
} else {
fout << "# Visual Studio 2013\n";
}
}
bool cmGlobalVisualStudio12Generator::IsWindowsDesktopToolsetInstalled() const
{
const char desktop81Key[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
......
......@@ -24,8 +24,6 @@ public:
bool MatchesGeneratorName(const std::string& name) const override;
void WriteSLNHeader(std::ostream& fout) override;
protected:
bool ProcessGeneratorToolsetField(std::string const& key,
std::string const& value) override;
......
......@@ -174,17 +174,6 @@ bool cmGlobalVisualStudio14Generator::SelectWindowsStoreToolset(
toolset);
}
void cmGlobalVisualStudio14Generator::WriteSLNHeader(std::ostream& fout)
{
// Visual Studio 14 writes .sln format 12.00
fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
if (this->ExpressEdition) {
fout << "# Visual Studio Express 14 for Windows Desktop\n";
} else {
fout << "# Visual Studio 14\n";
}
}
bool cmGlobalVisualStudio14Generator::IsWindowsDesktopToolsetInstalled() const
{
const char desktop10Key[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
......
......@@ -24,8 +24,6 @@ public:
bool MatchesGeneratorName(const std::string& name) const override;
void WriteSLNHeader(std::ostream& fout) override;
protected:
bool InitializeWindows(cmMakefile* mf) override;
bool InitializeWindowsStore(cmMakefile* mf) override;
......
......@@ -97,17 +97,6 @@ bool cmGlobalVisualStudio15Generator::MatchesGeneratorName(
return false;
}
void cmGlobalVisualStudio15Generator::WriteSLNHeader(std::ostream& fout)
{
// Visual Studio 15 writes .sln format 12.00
fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
if (this->ExpressEdition) {
fout << "# Visual Studio Express 15 for Windows Desktop\n";
} else {
fout << "# Visual Studio 15\n";
}
}
bool cmGlobalVisualStudio15Generator::SetGeneratorInstance(
std::string const& i, cmMakefile* mf)
{
......
......@@ -24,8 +24,6 @@ public:
bool MatchesGeneratorName(const std::string& name) const override;
void WriteSLNHeader(std::ostream& fout) override;
bool SetGeneratorInstance(std::string const& i, cmMakefile* mf) override;
bool GetVSInstance(std::string& dir) const;
......
......@@ -217,9 +217,3 @@ void cmGlobalVisualStudio71Generator::WriteProjectConfigurations(
}
}
}
// output standard header for dsw file
void cmGlobalVisualStudio71Generator::WriteSLNHeader(std::ostream& fout)
{
fout << "Microsoft Visual Studio Solution File, Format Version 8.00\n";
}
......@@ -34,7 +34,6 @@ protected:
void WriteExternalProject(std::ostream& fout, const std::string& name,
const char* path, const char* typeGuid,
const std::set<BT<std::string>>& depends) override;
void WriteSLNHeader(std::ostream& fout) override;
// Folders are not supported by VS 7.1.
bool UseFolderProperty() const override { return false; }
......
......@@ -134,7 +134,6 @@ protected:
virtual void WriteSLNGlobalSections(std::ostream& fout,
cmLocalGenerator* root);
virtual void WriteSLNFooter(std::ostream& fout);
virtual void WriteSLNHeader(std::ostream& fout) = 0;
std::string WriteUtilityDepend(const cmGeneratorTarget* target) override;
virtual void WriteTargetsToSolution(
......
......@@ -94,12 +94,6 @@ cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator(
vc9Express, cmSystemTools::KeyWOW64_32);
}
void cmGlobalVisualStudio9Generator::WriteSLNHeader(std::ostream& fout)
{
fout << "Microsoft Visual Studio Solution File, Format Version 10.00\n";
fout << "# Visual Studio 2008\n";
}
std::string cmGlobalVisualStudio9Generator::GetUserMacrosDirectory()
{
std::string base;
......
......@@ -17,12 +17,6 @@ public:
const std::string& platformName);
static cmGlobalGeneratorFactory* NewFactory();
/**
* Try to determine system information such as shared library
* extension, pthreads, byte order etc.
*/
void WriteSLNHeader(std::ostream& fout) override;
/**
* Where does this version of Visual Studio look for macros for the
* current user? Returns the empty string if this version of Visual
......
......@@ -62,6 +62,58 @@ const char* cmGlobalVisualStudioGenerator::GetIDEVersion() const
return "";
}
void cmGlobalVisualStudioGenerator::WriteSLNHeader(std::ostream& fout)
{
switch (this->Version) {
case cmGlobalVisualStudioGenerator::VS9:
fout << "Microsoft Visual Studio Solution File, Format Version 10.00\n";
fout << "# Visual Studio 2008\n";
break;
case cmGlobalVisualStudioGenerator::VS10:
fout << "Microsoft Visual Studio Solution File, Format Version 11.00\n";
if (this->ExpressEdition) {
fout << "# Visual C++ Express 2010\n";
} else {
fout << "# Visual Studio 2010\n";
}
break;
case cmGlobalVisualStudioGenerator::VS11:
fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
if (this->ExpressEdition) {
fout << "# Visual Studio Express 2012 for Windows Desktop\n";
} else {
fout << "# Visual Studio 2012\n";
}
break;
case cmGlobalVisualStudioGenerator::VS12:
fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
if (this->ExpressEdition) {
fout << "# Visual Studio Express 2013 for Windows Desktop\n";
} else {
fout << "# Visual Studio 2013\n";
}
break;
case cmGlobalVisualStudioGenerator::VS14:
// Visual Studio 14 writes .sln format 12.00
fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
if (this->ExpressEdition) {
fout << "# Visual Studio Express 14 for Windows Desktop\n";
} else {
fout << "# Visual Studio 14\n";
}
break;
case cmGlobalVisualStudioGenerator::VS15:
// Visual Studio 15 writes .sln format 12.00
fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
if (this->ExpressEdition) {
fout << "# Visual Studio Express 15 for Windows Desktop\n";
} else {
fout << "# Visual Studio 15\n";
}
break;
}
}
std::string cmGlobalVisualStudioGenerator::GetRegistryBase()
{
return cmGlobalVisualStudioGenerator::GetRegistryBase(this->GetIDEVersion());
......
......@@ -142,6 +142,8 @@ protected:
const char* GetIDEVersion() const;
void WriteSLNHeader(std::ostream& fout);
bool ComputeTargetDepends() override;
class VSDependSet : public std::set<std::string>
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment