mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:52:57 +00:00
Do automatic dependency checking for pre-compiled header files
svn path=/branches/xmlbuildsystem/; revision=15337
This commit is contained in:
parent
42715b124a
commit
0a8ee28a63
4 changed files with 39 additions and 17 deletions
|
@ -274,17 +274,31 @@ AutomaticDependency::Process ()
|
||||||
ProcessModule ( *project.modules[i] );
|
ProcessModule ( *project.modules[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
AutomaticDependency::GetModuleFiles ( Module& module,
|
||||||
|
vector<File*>& files ) const
|
||||||
|
{
|
||||||
|
for ( size_t i = 0; i < module.non_if_data.files.size (); i++ )
|
||||||
|
files.push_back ( module.non_if_data.files[i] );
|
||||||
|
|
||||||
|
/* FIXME: Collect files in IFs here */
|
||||||
|
|
||||||
|
if ( module.pch != NULL )
|
||||||
|
files.push_back ( &module.pch->file );
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AutomaticDependency::ProcessModule ( Module& module )
|
AutomaticDependency::ProcessModule ( Module& module )
|
||||||
{
|
{
|
||||||
const vector<File*>& files = module.non_if_data.files;
|
vector<File*> files;
|
||||||
|
GetModuleFiles ( module, files );
|
||||||
for ( size_t i = 0; i < files.size (); i++ )
|
for ( size_t i = 0; i < files.size (); i++ )
|
||||||
ProcessFile ( module, *files[i] );
|
ProcessFile ( module, *files[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
AutomaticDependency::ProcessFile ( Module& module,
|
AutomaticDependency::ProcessFile ( Module& module,
|
||||||
const File& file )
|
const File& file )
|
||||||
{
|
{
|
||||||
string normalizedFilename = NormalizeFilename ( file.name );
|
string normalizedFilename = NormalizeFilename ( file.name );
|
||||||
RetrieveFromCacheOrParse ( module,
|
RetrieveFromCacheOrParse ( module,
|
||||||
|
@ -388,7 +402,8 @@ AutomaticDependency::CheckAutomaticDependencies ( bool verbose )
|
||||||
struct utimbuf timebuf;
|
struct utimbuf timebuf;
|
||||||
for ( size_t mi = 0; mi < project.modules.size (); mi++ )
|
for ( size_t mi = 0; mi < project.modules.size (); mi++ )
|
||||||
{
|
{
|
||||||
const vector<File*>& files = project.modules[mi]->non_if_data.files;
|
vector<File*> files;
|
||||||
|
GetModuleFiles ( *project.modules[mi], files );
|
||||||
for ( size_t fi = 0; fi < files.size (); fi++ )
|
for ( size_t fi = 0; fi < files.size (); fi++ )
|
||||||
{
|
{
|
||||||
File& file = *files[fi];
|
File& file = *files[fi];
|
||||||
|
|
|
@ -840,7 +840,7 @@ MingwModuleHandler::GenerateGccCommand (
|
||||||
{
|
{
|
||||||
string dependencies = sourceFilename;
|
string dependencies = sourceFilename;
|
||||||
if ( module.pch && use_pch )
|
if ( module.pch && use_pch )
|
||||||
dependencies += " " + module.pch->header + ".gch";
|
dependencies += " " + module.pch->file.name + ".gch";
|
||||||
|
|
||||||
/* WIDL generated headers may be used */
|
/* WIDL generated headers may be used */
|
||||||
dependencies += " " + GetLinkingDependenciesMacro ();
|
dependencies += " " + GetLinkingDependenciesMacro ();
|
||||||
|
@ -1471,7 +1471,7 @@ MingwModuleHandler::GenerateObjectFileTargets (
|
||||||
{
|
{
|
||||||
if ( module.pch )
|
if ( module.pch )
|
||||||
{
|
{
|
||||||
const string& pch_file = module.pch->header;
|
const string& pch_file = module.pch->file.name;
|
||||||
string gch_file = pch_file + ".gch";
|
string gch_file = pch_file + ".gch";
|
||||||
CLEAN_FILE(gch_file);
|
CLEAN_FILE(gch_file);
|
||||||
if ( use_pch )
|
if ( use_pch )
|
||||||
|
@ -2920,9 +2920,9 @@ void
|
||||||
MingwTestModuleHandler::GetModuleSpecificSourceFiles ( vector<File*>& sourceFiles )
|
MingwTestModuleHandler::GetModuleSpecificSourceFiles ( vector<File*>& sourceFiles )
|
||||||
{
|
{
|
||||||
string basePath = "$(INTERMEDIATE)" SSEP + module.GetBasePath ();
|
string basePath = "$(INTERMEDIATE)" SSEP + module.GetBasePath ();
|
||||||
sourceFiles.push_back ( new File ( basePath + SSEP "_hooks.c", false, "" ) );
|
sourceFiles.push_back ( new File ( basePath + SSEP "_hooks.c", false, "", false ) );
|
||||||
sourceFiles.push_back ( new File ( basePath + SSEP "_stubs.S", false, "" ) );
|
sourceFiles.push_back ( new File ( basePath + SSEP "_stubs.S", false, "", false ) );
|
||||||
sourceFiles.push_back ( new File ( basePath + SSEP "_startup.c", false, "" ) );
|
sourceFiles.push_back ( new File ( basePath + SSEP "_startup.c", false, "", false ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -323,7 +323,8 @@ Module::ProcessXMLSubElement ( const XMLElement& e,
|
||||||
}
|
}
|
||||||
File* pFile = new File ( FixSeparator ( path + CSEP + e.value ),
|
File* pFile = new File ( FixSeparator ( path + CSEP + e.value ),
|
||||||
first,
|
first,
|
||||||
switches );
|
switches,
|
||||||
|
false );
|
||||||
if ( pIf )
|
if ( pIf )
|
||||||
pIf->data.files.push_back ( pFile );
|
pIf->data.files.push_back ( pFile );
|
||||||
else
|
else
|
||||||
|
@ -445,7 +446,7 @@ Module::ProcessXMLSubElement ( const XMLElement& e,
|
||||||
e.location,
|
e.location,
|
||||||
"Only one <pch> is valid per module" );
|
"Only one <pch> is valid per module" );
|
||||||
pch = new PchFile (
|
pch = new PchFile (
|
||||||
e, *this, FixSeparator ( path + CSEP + e.value ) );
|
e, *this, File ( FixSeparator ( path + CSEP + e.value ), false, "", true ) );
|
||||||
subs_invalid = true;
|
subs_invalid = true;
|
||||||
}
|
}
|
||||||
if ( subs_invalid && e.subElements.size() > 0 )
|
if ( subs_invalid && e.subElements.size() > 0 )
|
||||||
|
@ -729,10 +730,12 @@ Module::InvokeModule () const
|
||||||
|
|
||||||
|
|
||||||
File::File ( const string& _name, bool _first,
|
File::File ( const string& _name, bool _first,
|
||||||
std::string _switches )
|
std::string _switches,
|
||||||
|
bool _isPreCompiledHeader )
|
||||||
: name(_name),
|
: name(_name),
|
||||||
first(_first),
|
first(_first),
|
||||||
switches(_switches)
|
switches(_switches),
|
||||||
|
isPreCompiledHeader(_isPreCompiledHeader)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1011,8 +1014,8 @@ Property::ProcessXML()
|
||||||
PchFile::PchFile (
|
PchFile::PchFile (
|
||||||
const XMLElement& node_,
|
const XMLElement& node_,
|
||||||
const Module& module_,
|
const Module& module_,
|
||||||
const string& header_ )
|
const File file_ )
|
||||||
: node(node_), module(module_), header(header_)
|
: node(node_), module(module_), file(file_)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -278,10 +278,12 @@ public:
|
||||||
std::string name;
|
std::string name;
|
||||||
bool first;
|
bool first;
|
||||||
std::string switches;
|
std::string switches;
|
||||||
|
bool isPreCompiledHeader;
|
||||||
|
|
||||||
File ( const std::string& _name,
|
File ( const std::string& _name,
|
||||||
bool _first,
|
bool _first,
|
||||||
std::string _switches );
|
std::string _switches,
|
||||||
|
bool _isPreCompiledHeader );
|
||||||
|
|
||||||
void ProcessXML();
|
void ProcessXML();
|
||||||
bool IsGeneratedFile () const;
|
bool IsGeneratedFile () const;
|
||||||
|
@ -570,6 +572,8 @@ public:
|
||||||
void CheckAutomaticDependencies ( bool verbose );
|
void CheckAutomaticDependencies ( bool verbose );
|
||||||
void CheckAutomaticDependenciesForFile ( SourceFile* sourceFile );
|
void CheckAutomaticDependenciesForFile ( SourceFile* sourceFile );
|
||||||
private:
|
private:
|
||||||
|
void GetModuleFiles ( Module& module,
|
||||||
|
std::vector<File*>& files ) const;
|
||||||
void ProcessModule ( Module& module );
|
void ProcessModule ( Module& module );
|
||||||
void ProcessFile ( Module& module,
|
void ProcessFile ( Module& module,
|
||||||
const File& file );
|
const File& file );
|
||||||
|
@ -640,12 +644,12 @@ class PchFile
|
||||||
public:
|
public:
|
||||||
const XMLElement& node;
|
const XMLElement& node;
|
||||||
const Module& module;
|
const Module& module;
|
||||||
std::string header;
|
File file;
|
||||||
|
|
||||||
PchFile (
|
PchFile (
|
||||||
const XMLElement& node,
|
const XMLElement& node,
|
||||||
const Module& module,
|
const Module& module,
|
||||||
const std::string& header );
|
const File file );
|
||||||
void ProcessXML();
|
void ProcessXML();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue