added new cmdline switch to rbuild: -vs{version}
to select the version of MS VS project files to generate
default is now 7.10 (VS 2003)
Modified: trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
Modified: trunk/reactos/tools/rbuild/rbuild.cpp
Modified: trunk/reactos/tools/rbuild/rbuild.h
_____
Modified: trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
--- trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
2005-10-20 01:24:49 UTC (rev 18620)
+++ trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
2005-10-20 06:40:58 UTC (rev 18621)
@@ -171,7 +171,11 @@
fprintf ( OUT, "<?xml version=\"1.0\" encoding =
\"Windows-1252\"?>\r\n" );
fprintf ( OUT, "<VisualStudioProject\r\n" );
fprintf ( OUT, "\tProjectType=\"Visual C++\"\r\n" );
- fprintf ( OUT, "\tVersion=\"7.00\"\r\n" );
+
+ if (configuration.VSProjectVersion.empty())
+ configuration.VSProjectVersion = MS_VS_DEF_VERSION;
+
+ fprintf ( OUT, "\tVersion=\"%s\"\r\n",
configuration.VSProjectVersion.c_str() );
fprintf ( OUT, "\tName=\"%s\"\r\n", module.name.c_str() );
fprintf ( OUT, "\tKeyword=\"Win32Proj\">\r\n" );
@@ -386,8 +390,22 @@
void
MSVCBackend::_generate_sln_header ( FILE* OUT )
{
- fprintf ( OUT, "Microsoft Visual Studio Solution File, Format
Version 9.00\r\n" );
- fprintf ( OUT, "# Visual C++ Express 2005\r\n" );
+ if (configuration.VSProjectVersion.empty())
+ configuration.VSProjectVersion = MS_VS_DEF_VERSION;
+
+ string version;
+
+ if (configuration.VSProjectVersion == "7.00")
+ version = "7.00";
+
+ if (configuration.VSProjectVersion == "7.10")
+ version = "8.00";
+
+ if (configuration.VSProjectVersion == "8.00")
+ version = "9.00";
+
+ fprintf ( OUT, "Microsoft Visual Studio Solution File, Format
Version %s\r\n", version.c_str() );
+ fprintf ( OUT, "# Visual Studio 2005\r\n" );
fprintf ( OUT, "\r\n" );
}
@@ -410,7 +428,7 @@
/*
m_devFile << "Microsoft Visual Studio Solution File, Format
Version 9.00" << endl;
- m_devFile << "# Visual C++ Express 2005" << endl;
+ m_devFile << "# Visual Studio 2005" << endl;
m_devFile << "# FIXME Project listings here" << endl;
m_devFile << "EndProject" << endl;
_____
Modified: trunk/reactos/tools/rbuild/rbuild.cpp
--- trunk/reactos/tools/rbuild/rbuild.cpp 2005-10-20 01:24:49 UTC
(rev 18620)
+++ trunk/reactos/tools/rbuild/rbuild.cpp 2005-10-20 06:40:58 UTC
(rev 18621)
@@ -61,7 +61,42 @@
return true;
}
+
bool
+ParseVCProjectSwitch ( char switchChar2,
+ char* switchStart )
+{
+ switch ( switchChar2 )
+ {
+ case 's':
+ if ( strlen ( switchStart ) <= 3 )
+ {
+ printf ( "Switch -dm requires a module
name\n" );
+ return false;
+ }
+ configuration.VSProjectVersion =
string(&switchStart[3]);
+
+ if (configuration.VSProjectVersion.at(0) == '{')
{
+ printf ( "Error: invalid char {\n" );
+ return false;
+ }
+
+ if (configuration.VSProjectVersion.length() ==
1) //7,8
+
configuration.VSProjectVersion.append(".00");
+
+ if (configuration.VSProjectVersion.length() ==
3) //7.1
+
configuration.VSProjectVersion.append("0");
+
+ break;
+ default:
+ printf ( "Unknown switch -d%c\n",
+ switchChar2 );
+ return false;
+ }
+ return true;
+}
+
+bool
ParseMakeSwitch ( char switchChar2 )
{
switch ( switchChar2 )
@@ -101,7 +136,11 @@
switch ( switchChar )
{
case 'v':
- configuration.Verbose = true;
+ if (switchChar2 == 's')
+ return ParseVCProjectSwitch (
switchChar2,
+
argv[index] );
+ else
+ configuration.Verbose = true;
break;
case 'c':
configuration.CleanAsYouGo = true;
@@ -163,11 +202,12 @@
printf ( " not generate the
directories.\n" );
printf ( " -ps Generate proxy makefiles in
source tree instead of the output.\n" );
printf ( " tree.\n" );
+ printf ( " -vs{version} Version of MS VS project
files. Default is %s.\n", MS_VS_DEF_VERSION );
printf ( "\n" );
printf ( " buildsystem Target build system. Can be
one of:\n" );
printf ( " mingw MinGW\n" );
- printf ( " devcpp DevC++\n\n" );
- printf ( " msvc Generates dsp files for MSVC"
);
+ printf ( " devcpp DevC++\n" );
+ printf ( " msvc MS Visual Studio\n"
);
return 1;
}
try
_____
Modified: trunk/reactos/tools/rbuild/rbuild.h
--- trunk/reactos/tools/rbuild/rbuild.h 2005-10-20 01:24:49 UTC (rev
18620)
+++ trunk/reactos/tools/rbuild/rbuild.h 2005-10-20 06:40:58 UTC (rev
18621)
@@ -57,6 +57,8 @@
#define SBAD_SEP "\\"
#endif
+#define MS_VS_DEF_VERSION "7.10"
+
class Project;
class IfableData;
class Module;
@@ -95,6 +97,7 @@
bool AutomaticDependencies;
bool CheckDependenciesForModuleOnly;
std::string CheckDependenciesForModuleOnlyModule;
+ std::string VSProjectVersion;
bool MakeHandlesInstallDirectories;
bool GenerateProxyMakefilesInSourceTree;
};
Show replies by date