Robin Geuze (r DOT geuze AT chello DOT nl):
authorColin Finck <colin@reactos.org>
Sun, 11 May 2008 18:30:36 +0000 (18:30 +0000)
committerColin Finck <colin@reactos.org>
Sun, 11 May 2008 18:30:36 +0000 (18:30 +0000)
- Add the correct Visual Studio version to the .sln file header, so that the Visual Studio Version Selector does not get confused.
  I slightly modified the patch to replace some following if's by else if's.

svn path=/trunk/; revision=33446

reactos/tools/rbuild/backend/msvc/msvc.h
reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp

index c8fe546..a321f4e 100644 (file)
@@ -114,6 +114,7 @@ class MSVCBackend : public Backend
 
                std::string _strip_gcc_deffile(std::string Filename, std::string sourcedir, std::string objdir);
                std::string _get_solution_version ( void );
+               std::string _get_studio_version ( void );
                std::string _gen_guid();
                std::string _replace_str(
                        std::string string1,
@@ -147,4 +148,3 @@ class MSVCBackend : public Backend
 };
 
 #endif // __MSVC_H__
-
index 01c452a..8fed100 100644 (file)
@@ -966,26 +966,49 @@ MSVCBackend::_get_solution_version ( void )
        if (configuration.VSProjectVersion.empty())
                configuration.VSProjectVersion = MS_VS_DEF_VERSION;
 
-       if (configuration.VSProjectVersion == "7.00")
+       else if (configuration.VSProjectVersion == "7.00")
                version = "7.00";
 
-       if (configuration.VSProjectVersion == "7.10")
+       else if (configuration.VSProjectVersion == "7.10")
                version = "8.00";
 
-       if (configuration.VSProjectVersion == "8.00")
+       else if (configuration.VSProjectVersion == "8.00")
                version = "9.00";
 
-       if (configuration.VSProjectVersion == "9.00")
+       else if (configuration.VSProjectVersion == "9.00")
                version = "10.00";
 
        return version;
 }
 
+std::string
+MSVCBackend::_get_studio_version ( void )
+{
+       string version;
+
+       if (configuration.VSProjectVersion.empty())
+               configuration.VSProjectVersion = MS_VS_DEF_VERSION;
+       
+       else if (configuration.VSProjectVersion == "7.00")
+               version = "2002";
+
+       else if (configuration.VSProjectVersion == "7.10")
+               version = "2003";
+
+       else if (configuration.VSProjectVersion == "8.00")
+               version = "2005";
+
+       else if (configuration.VSProjectVersion == "9.00")
+               version = "2008";
+
+       return version;
+}
+
 void
 MSVCBackend::_generate_sln_header ( FILE* OUT )
 {
        fprintf ( OUT, "Microsoft Visual Studio Solution File, Format Version %s\r\n", _get_solution_version().c_str() );
-       fprintf ( OUT, "# Visual Studio 2005\r\n" );
+       fprintf ( OUT, "# Visual Studio %s\r\n", _get_studio_version().c_str() );
        fprintf ( OUT, "\r\n" );
 }