fix vcprojmaker to add the correct GUIDs
implemented Debug/Release configurations to make Alex happy
Modified: trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp
Modified: trunk/reactos/tools/rbuild/backend/msvc/msvc.h
Modified: trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
_____
Modified: trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp
--- trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp 2005-10-20
09:43:49 UTC (rev 18623)
+++ trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp 2005-10-20
11:21:23 UTC (rev 18624)
@@ -31,8 +31,6 @@
using namespace std;
-void gen_guid();
-
static class MSVCFactory : public Backend::Factory
{
public:
@@ -93,10 +91,11 @@
{
Module &module = *ProjectNode.modules[i];
+ module.guid = _gen_guid();
this->_generate_dsp ( module );
this->_generate_vcproj ( module );
-// gen_guid();
+
/*for(size_t k = 0; k < module.non_if_data.files.size();
k++)
{
File &file = *module.non_if_data.files[k];
_____
Modified: trunk/reactos/tools/rbuild/backend/msvc/msvc.h
--- trunk/reactos/tools/rbuild/backend/msvc/msvc.h 2005-10-20
09:43:49 UTC (rev 18623)
+++ trunk/reactos/tools/rbuild/backend/msvc/msvc.h 2005-10-20
11:21:23 UTC (rev 18624)
@@ -86,7 +86,7 @@
const std::string &replace_str);
void _generate_vcproj ( const Module& module );
-
+
void _generate_sln_header ( FILE* OUT );
void _generate_sln_footer ( FILE* OUT );
void _generate_sln ( FILE* OUT );
@@ -97,6 +97,9 @@
std::string sln_guid,
std::string vcproj_guid,
const std::vector<Dependency*>& dependencies );
+ void _generate_sln_configurations (
+ FILE* OUT,
+ std::string vcproj_guid );
};
_____
Modified: trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
--- trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
2005-10-20 09:43:49 UTC (rev 18623)
+++ trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
2005-10-20 11:21:23 UTC (rev 18624)
@@ -140,7 +140,8 @@
std::vector<std::string> cfgs;
- cfgs.push_back ( module.name + " - Win32" );
+ cfgs.push_back ( "Debug" );
+ cfgs.push_back ( "Release" );
if (!no_cpp)
{
@@ -177,6 +178,7 @@
fprintf ( OUT, "\tVersion=\"%s\"\r\n",
configuration.VSProjectVersion.c_str() );
fprintf ( OUT, "\tName=\"%s\"\r\n", module.name.c_str() );
+ fprintf ( OUT, "\tProjectGUID=\"%s\"\r\n", module.guid.c_str()
);
fprintf ( OUT, "\tKeyword=\"Win32Proj\">\r\n" );
fprintf ( OUT, "\t<Platforms>\r\n" );
@@ -436,12 +438,11 @@
std::string vcproj_guid,
const std::vector<Dependency*>& dependencies )
{
-
- vcproj_file = DosSeparator ( std::string(".\\") + vcproj_file );
+ vcproj_file = DosSeparator ( std::string(".\\") + vcproj_file );
fprintf ( OUT, "Project(\"%s\") = \"%s\", \"%s\",
\"%s\"\r\n",
sln_guid.c_str() , module.name.c_str(), vcproj_file.c_str(),
vcproj_guid.c_str() );
- fprintf ( OUT, " ProjectSection(ProjectDependencies) =
postProject\r\n" );
- fprintf ( OUT, " EndProjectSection\r\n" );
+ fprintf ( OUT, "\tProjectSection(ProjectDependencies) =
postProject\r\n" );
+ fprintf ( OUT, "\tEndProjectSection\r\n" );
fprintf ( OUT, "EndProject\r\n" );
}
@@ -449,17 +450,23 @@
void
MSVCBackend::_generate_sln_footer ( FILE* OUT )
{
- fprintf ( OUT, "Global\r\n" );
-
- fprintf ( OUT, " GlobalSection(SolutionConfiguration) =
preSolution\r\n" );
- fprintf ( OUT, " Debug = Debug\r\n" );
- fprintf ( OUT, " Release = Release\r\n" );
- fprintf ( OUT, " EndGlobalSection\r\n" );
-
- fprintf ( OUT, " GlobalSection(ExtensibilityGlobals) =
postSolution\r\n" );
- fprintf ( OUT, " EndGlobalSection\r\n" );
- fprintf ( OUT, " GlobalSection(ExtensibilityAddIns) =
postSolution\r\n" );
- fprintf ( OUT, " EndGlobalSection\r\n" );
+ fprintf ( OUT, "Global\r\n" );
+ fprintf ( OUT, "\tGlobalSection(SolutionConfiguration) =
preSolution\r\n" );
+ fprintf ( OUT, "\t\tDebug = Debug\r\n" );
+ fprintf ( OUT, "\t\tRelease = Release\r\n" );
+ fprintf ( OUT, "\tEndGlobalSection\r\n" );
+ fprintf ( OUT, "\tGlobalSection(ProjectConfiguration) =
postSolution\r\n" );
+ for ( size_t i = 0; i < ProjectNode.modules.size(); i++ )
+ {
+ Module& module = *ProjectNode.modules[i];
+ std::string guid = module.guid;
+ _generate_sln_configurations ( OUT, guid.c_str() );
+ }
+ fprintf ( OUT, "\tEndGlobalSection\r\n" );
+ fprintf ( OUT, "\tGlobalSection(ExtensibilityGlobals) =
postSolution\r\n" );
+ fprintf ( OUT, "\tEndGlobalSection\r\n" );
+ fprintf ( OUT, "\tGlobalSection(ExtensibilityAddIns) =
postSolution\r\n" );
+ fprintf ( OUT, "\tEndGlobalSection\r\n" );
fprintf ( OUT, "EndGlobal\r\n" );
@@ -468,20 +475,29 @@
void
+MSVCBackend::_generate_sln_configurations ( FILE* OUT, std::string
vcproj_guid )
+{
+ fprintf ( OUT, "\t\t%s.Debug.ActiveCfg = Debug|Win32\r\n",
vcproj_guid.c_str() );
+ fprintf ( OUT, "\t\t%s.Debug.Build.0 = Debug|Win32\r\n",
vcproj_guid.c_str() );
+ fprintf ( OUT, "\t\t%s.Debug.Release.ActiveCfg =
Release|Win32\r\n", vcproj_guid.c_str() );
+ fprintf ( OUT, "\t\t%s.Debug.Release.Build.0 =
Release|Win32\r\n", vcproj_guid.c_str() );
+}
+
+void
MSVCBackend::_generate_sln ( FILE* OUT )
{
string sln_guid = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}";
+ vector<string> guids;
_generate_sln_header(OUT);
// TODO FIXME - is it necessary to sort them?
for ( size_t i = 0; i < ProjectNode.modules.size(); i++ )
{
Module& module = *ProjectNode.modules[i];
-
+
std::string vcproj_file = VcprojFileName ( module );
- std::string vcproj_guid = _gen_guid();
- _generate_sln_project ( OUT, module, vcproj_file,
sln_guid, vcproj_guid, module.dependencies );
- }
- _generate_sln_footer ( OUT );
+ _generate_sln_project ( OUT, module, vcproj_file,
sln_guid, module.guid, module.dependencies );
+ }
+ _generate_sln_footer ( OUT );
}