Author: hpoussin
Date: Thu Jun 15 16:33:47 2006
New Revision: 22356
URL:
http://svn.reactos.ru/svn/reactos?rev=22356&view=rev
Log:
Create configuration list only once (in MSVCBackend::Process) and use it everywhere.
Remove dead code
Modified:
trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp
trunk/reactos/tools/rbuild/backend/msvc/msvc.h
trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
Modified: trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/m…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp Thu Jun 15 16:33:47 2006
@@ -56,6 +56,27 @@
void MSVCBackend::Process()
{
+ // TODO FIXME wine hack?
+ bool only_msvc_headers = false;
+
+ while ( m_configurations.size () > 0 )
+ {
+ const MSVCConfiguration* cfg = m_configurations.back();
+ m_configurations.pop_back();
+ delete cfg;
+ }
+
+ m_configurations.push_back ( new MSVCConfiguration( Debug ));
+ m_configurations.push_back ( new MSVCConfiguration( Release ));
+ m_configurations.push_back ( new MSVCConfiguration( Speed ));
+
+ if (!only_msvc_headers)
+ {
+ m_configurations.push_back ( new MSVCConfiguration( Debug, WineHeaders ));
+ m_configurations.push_back ( new MSVCConfiguration( Release, WineHeaders ));
+ m_configurations.push_back ( new MSVCConfiguration( Speed, WineHeaders ));
+ }
+
if ( configuration.CleanAsYouGo ) {
_clean_project_files();
return;
@@ -65,20 +86,11 @@
return;
}
string filename_sln ( ProjectNode.name );
- //string filename_rules = "gccasm.rules";
if ( configuration.VSProjectVersion == "6.00" )
filename_sln += "_auto.dsw";
- else {
+ else
filename_sln += "_auto.sln";
-
- //m_rulesFile = fopen ( filename_rules.c_str(), "wb" );
- //if ( m_rulesFile )
- //{
- // _generate_rules_file ( m_rulesFile );
- //}
- //fclose ( m_rulesFile );
- }
printf ( "Creating MSVC workspace: %s\n", filename_sln.c_str() );
@@ -112,14 +124,6 @@
_generate_dsp ( module );
else
_generate_vcproj ( module );
-
-
- /*for(size_t k = 0; k < module.non_if_data.files.size(); k++)
- {
- File &file = *module.non_if_data.files[k];
-
- ProcessFile(file.name);
- }*/
}
}
Modified: trunk/reactos/tools/rbuild/backend/msvc/msvc.h
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/m…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/msvc/msvc.h (original)
+++ trunk/reactos/tools/rbuild/backend/msvc/msvc.h Thu Jun 15 16:33:47 2006
@@ -86,7 +86,7 @@
std::string SuoFileName ( const Module& module ) const;
std::string NcbFileName ( const Module& module ) const;
-
+ std::vector<MSVCConfiguration*> m_configurations;
std::vector<FileUnit> m_fileUnits;
std::vector<std::string> m_folders;
Modified: trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/v…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp Thu Jun 15 16:33:47 2006
@@ -100,23 +100,6 @@
bool console = exe && (module.type == Win32CUI);
- // TODO FIXME - not sure if the count here is right...
- int parts = 0;
- const char* p = strpbrk ( vcproj_file.c_str(), "/\\" );
- while ( p )
- {
- ++parts;
- p = strpbrk ( p+1, "/\\" );
- }
- string msvc_wine_dir = "..";
- while ( --parts )
- msvc_wine_dir += "\\..";
-
- string wine_include_dir = msvc_wine_dir + "\\include";
-
- //$progress_current++;
- //$output->progress("$dsp_file (file $progress_current of
$progress_max)");
-
string vcproj_path = module.GetBasePath();
vector<string> source_files, resource_files, includes, includes_wine, libraries;
StringSet common_defines;
@@ -194,22 +177,6 @@
vector<string> header_files;
- // TODO FIXME wine hack?
- bool no_msvc_headers = true;
-
- std::vector<MSVCConfiguration*> cfgs;
-
- cfgs.push_back ( new MSVCConfiguration( Debug ));
- cfgs.push_back ( new MSVCConfiguration( Release ));
- cfgs.push_back ( new MSVCConfiguration( Speed ));
-
- if (!no_msvc_headers)
- {
- cfgs.push_back ( new MSVCConfiguration( Debug, WineHeaders ));
- cfgs.push_back ( new MSVCConfiguration( Release, WineHeaders ));
- cfgs.push_back ( new MSVCConfiguration( Speed, WineHeaders ));
- }
-
string include_string;
fprintf ( OUT, "<?xml version=\"1.0\" encoding =
\"Windows-1252\"?>\r\n" );
@@ -243,9 +210,9 @@
std::string output_dir;
fprintf ( OUT, "\t<Configurations>\r\n" );
- for ( size_t icfg = 0; icfg < cfgs.size(); icfg++ )
- {
- const MSVCConfiguration& cfg = *cfgs[icfg];
+ for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ )
+ {
+ const MSVCConfiguration& cfg = *m_configurations[icfg];
bool debug = ( cfg.optimization == Debug );
bool release = ( cfg.optimization == Release );
@@ -272,7 +239,6 @@
{
if ( multiple_includes )
fprintf ( OUT, ";" );
-
fprintf ( OUT, "%s", include.c_str() );
include_string += " /I " + include;
multiple_includes = true;
@@ -523,9 +489,9 @@
fprintf ( OUT, "\t\t\t<File\r\n" );
fprintf ( OUT, "\t\t\t\tRelativePath=\"%s\">\r\n",
source_file.c_str() );
- for ( size_t iconfig = 0; iconfig < cfgs.size(); iconfig++ )
- {
- const MSVCConfiguration& config = *cfgs[iconfig];
+ for ( size_t iconfig = 0; iconfig < m_configurations.size(); iconfig++ )
+ {
+ const MSVCConfiguration& config = *m_configurations[iconfig];
if (( isrcfile == 0 ) && ( module.pch != NULL ))
{
@@ -635,31 +601,6 @@
return version;
}
-
-//void
-//MSVCBackend::_generate_rules_file ( FILE* OUT )
-//{
-// fprintf ( OUT, "<?xml version=\"1.0\"
encoding=\"utf-8\"?>\r\n" );
-// fprintf ( OUT, "<VisualStudioToolFile\r\n" );
-// fprintf ( OUT, "\tName=\"GCC Assembler\"\r\n" );
-// fprintf ( OUT, "\tVersion=\"%s\"\r\n",
_get_solution_verion().c_str() );
-// fprintf ( OUT, "\t>\r\n" );
-// fprintf ( OUT, "\t<Rules>\r\n" );
-// fprintf ( OUT, "\t\t<CustomBuildRule\r\n" );
-// fprintf ( OUT, "\t\t\tName=\"Assembler\"\r\n" );
-// fprintf ( OUT, "\t\t\tDisplayName=\"Assembler Files\"\r\n" );
-// fprintf ( OUT, "\t\t\tCommandLine=\"cl /E "$(InputPath)" |
as -o "$(OutDir)\\$(InputName).obj"\"\r\n" );
-// fprintf ( OUT, "\t\t\tOutputs=\"$(OutDir)\\$(InputName).obj\"\r\n"
);
-// fprintf ( OUT, "\t\t\tFileExtensions=\"*.S\"\r\n" );
-// fprintf ( OUT, "\t\t\tExecutionDescription=\"asm\"\r\n" );
-// fprintf ( OUT, "\t\t\t>\r\n" );
-// fprintf ( OUT, "\t\t\t<Properties>\r\n" );
-// fprintf ( OUT, "\t\t\t</Properties>\r\n" );
-// fprintf ( OUT, "\t\t</CustomBuildRule>\r\n" );
-// fprintf ( OUT, "\t</Rules>\r\n" );
-// fprintf ( OUT, "</VisualStudioToolFile>\r\n" );
-//}
-
void
MSVCBackend::_generate_sln_header ( FILE* OUT )
{
@@ -703,8 +644,8 @@
{
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" );
+ for ( size_t i = 0; i < m_configurations.size(); i++ )
+ fprintf ( OUT, "\t\t%s = %s\r\n", m_configurations[i]->name.c_str(),
m_configurations[i]->name.c_str() );
fprintf ( OUT, "\tEndGlobalSection\r\n" );
fprintf ( OUT, "\tGlobalSection(ProjectConfiguration) = postSolution\r\n" );
for ( size_t i = 0; i < ProjectNode.modules.size(); i++ )
@@ -739,10 +680,12 @@
void
MSVCBackend::_generate_sln_configurations ( FILE* OUT, std::string vcproj_guid )
{
- fprintf ( OUT, "\t\t%s.Debug|Win32.ActiveCfg = Debug|Win32\r\n",
vcproj_guid.c_str() );
- fprintf ( OUT, "\t\t%s.Debug|Win32.Build.0 = Debug|Win32\r\n",
vcproj_guid.c_str() );
- fprintf ( OUT, "\t\t%s.Release|Win32.ActiveCfg = Release|Win32\r\n",
vcproj_guid.c_str() );
- fprintf ( OUT, "\t\t%s.Release|Win32.Build.0 = Release|Win32\r\n",
vcproj_guid.c_str() );
+ for ( size_t i = 0; i < m_configurations.size (); i++)
+ {
+ const MSVCConfiguration& cfg = *m_configurations[i];
+ fprintf ( OUT, "\t\t%s.%s|Win32.ActiveCfg = %s|Win32\r\n",
vcproj_guid.c_str(), cfg.name.c_str(), cfg.name.c_str() );
+ fprintf ( OUT, "\t\t%s.%s|Win32.Build.0 = %s|Win32\r\n", vcproj_guid.c_str(),
cfg.name.c_str(), cfg.name.c_str() );
+ }
}
void