invoke _generate_dsp() have it open the output file, and fix some path
parsing and const issues.
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/msvcmaker.cpp
_____
Modified: trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp
--- trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp 2005-08-24
18:29:45 UTC (rev 17516)
+++ trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp 2005-08-24
19:58:07 UTC (rev 17517)
@@ -119,12 +119,14 @@
{
Module &module = *ProjectNode.modules[i];
- for(size_t k = 0; k < module.non_if_data.files.size();
k++)
+ this->_generate_dsp ( 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
--- trunk/reactos/tools/rbuild/backend/msvc/msvc.h 2005-08-24
18:29:45 UTC (rev 17516)
+++ trunk/reactos/tools/rbuild/backend/msvc/msvc.h 2005-08-24
19:58:07 UTC (rev 17517)
@@ -64,7 +64,7 @@
// functions in msvcmaker.cpp:
- void _generate_dsp ( FILE* OUT, const std::string&
moduleName );
+ void _generate_dsp ( const Module& module );
void _generate_dsw_header ( FILE* OUT );
_____
Modified: trunk/reactos/tools/rbuild/backend/msvc/msvcmaker.cpp
--- trunk/reactos/tools/rbuild/backend/msvc/msvcmaker.cpp
2005-08-24 18:29:45 UTC (rev 17516)
+++ trunk/reactos/tools/rbuild/backend/msvc/msvcmaker.cpp
2005-08-24 19:58:07 UTC (rev 17517)
@@ -13,15 +13,15 @@
using std::vector;
void
-MSVCBackend::_generate_dsp ( FILE* OUT, const std::string& moduleName )
+MSVCBackend::_generate_dsp ( const Module& module )
{
size_t i;
// TODO FIXME wine hack?
const bool wine = false;
- Module& module = *ProjectNode.LocateModule ( moduleName );
+ string dsp_file = DspFileName(module);
+ FILE* OUT = fopen ( dsp_file.c_str(), "w" );
- string dsp_file = DspFileName(module);
vector<string> imports;
for ( i = 0; i < module.non_if_data.libraries.size(); i++ )
{
@@ -32,19 +32,20 @@
bool lib = (module_type == "lib");
bool dll = (module_type == "dll");
bool exe = (module_type == "exe");
+ // TODO FIXME - need more checks here for 'sys' and possibly
'drv'?
bool console = exe; // FIXME: Not always correct
// TODO FIXME - not sure if the count here is right...
- int parts = 1;
- const char* p = strchr ( dsp_file.c_str(), '/' );
+ int parts = 0;
+ const char* p = strpbrk ( dsp_file.c_str(), "/\\" );
while ( p )
{
++parts;
- p = strchr ( p+1, '/' );
+ p = strpbrk ( p+1, "/\\" );
}
string msvc_wine_dir = "..";
- while ( parts-- )
+ while ( --parts )
msvc_wine_dir += "\\..";
string wine_include_dir = msvc_wine_dir + "\\include";
@@ -54,16 +55,16 @@
// TODO FIXME - what's diff. betw. 'c_srcs' and 'source_files'?
vector<string> c_srcs, source_files, resource_files;
- vector<IfableData*> ifs_list;
+ vector<const IfableData*> ifs_list;
ifs_list.push_back ( &module.non_if_data );
while ( ifs_list.size() )
{
- IfableData& data = *ifs_list.back();
+ const IfableData& data = *ifs_list.back();
ifs_list.pop_back();
// TODO FIXME - refactor needed - we're discarding if
conditions
for ( i = 0; i < data.ifs.size(); i++ )
ifs_list.push_back ( &data.ifs[i]->data );
- vector<File*>& files = data.files;
+ const vector<File*>& files = data.files;
for ( i = 0; i < files.size(); i++ )
{
// TODO FIXME - do we want the full path of the
file here?