From 9264ed75827ca06d760e7c1f26c2e256727fa368 Mon Sep 17 00:00:00 2001 From: Royce Mitchell III Date: Wed, 12 Jan 2005 06:02:58 +0000 Subject: [PATCH] support for tag .PHONY must be output before the target gets defined svn path=/branches/xmlbuildsystem/; revision=12944 --- reactos/ReactOS.xml | 9 + reactos/ntoskrnl/ntoskrnl.xml | 42 +-- .../rbuild/backend/mingw/modulehandler.cpp | 294 +++++++++++++----- .../rbuild/backend/mingw/modulehandler.h | 50 ++- reactos/tools/rbuild/module.cpp | 99 +++++- reactos/tools/rbuild/rbuild.h | 22 +- 6 files changed, 381 insertions(+), 135 deletions(-) diff --git a/reactos/ReactOS.xml b/reactos/ReactOS.xml index 406ff9631a9..a4846c384ed 100644 --- a/reactos/ReactOS.xml +++ b/reactos/ReactOS.xml @@ -6,9 +6,18 @@ + + + + + + + + include w32api/include + diff --git a/reactos/ntoskrnl/ntoskrnl.xml b/reactos/ntoskrnl/ntoskrnl.xml index 286251fb3fb..073813e09e2 100644 --- a/reactos/ntoskrnl/ntoskrnl.xml +++ b/reactos/ntoskrnl/ntoskrnl.xml @@ -41,10 +41,9 @@ rtlfunc.c - - - - - - dbgctrl.c errinfo.c print.c diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp index 4542a1fd3ba..43df9ba8707 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp @@ -237,12 +237,14 @@ MingwModuleHandler::GenerateGccIncludeParametersFromVector ( const vector& files, + const vector* includes, + const vector& defines, + const string& cflags_macro, + const string& nasmflags_macro, + const string& objs_macro) const { - return ssprintf(" $(%s_CFLAGS)", module.name.c_str()); + size_t i; + + if ( (includes && includes->size()) || defines.size() ) + { + fprintf ( + fMakefile, + "%s %s", + cflags_macro.c_str(), + op ); + if ( includes ) + for ( i = 0; i < includes->size(); i++ ) + fprintf ( + fMakefile, + " -I%s", + (*includes)[i]->directory.c_str() ); + for ( i = 0; i < module.defines.size(); i++ ) + { + Define& d = *module.defines[i]; + fprintf ( + fMakefile, + " -D%s", + d.name.c_str() ); + if ( d.value.size() ) + fprintf ( + fMakefile, + "=%s", + d.value.c_str() ); + } + fprintf ( fMakefile, "\n" ); + } + + if ( files.size() ) + { + fprintf ( + fMakefile, + "%s %s", + objs_macro.c_str(), + op ); + for ( i = 0; i < files.size(); i++ ) + { + fprintf ( + fMakefile, + "%s%s", + ( i%10 == 9 ? "\\\n\t" : " " ), + GetObjectFilename(files[i]->name).c_str() ); + } + fprintf ( fMakefile, "\n" ); + } } -string -MingwModuleHandler::GenerateNasmParameters ( const Module& module ) const -{ - return ""; +void +MingwModuleHandler::GenerateMacros ( + const Module& module, + const string& cflags_macro, + const string& nasmflags_macro, + const string& objs_macro) const +{ + GenerateMacros ( + module, + "=", + module.files, + &module.includes, + module.defines, + cflags_macro, + nasmflags_macro, + objs_macro ); + fprintf ( fMakefile, "\n" ); + + for ( size_t i = 0; i < module.ifs.size(); i++ ) + { + If& rIf = *module.ifs[i]; + if ( rIf.defines.size() || rIf.files.size() ) + { + fprintf ( + fMakefile, + "ifeq ($(%s),\"%s\")\n", + rIf.property.c_str(), + rIf.value.c_str() ); + GenerateMacros ( + module, + "+=", + rIf.files, + NULL, + rIf.defines, + cflags_macro, + nasmflags_macro, + objs_macro ); + fprintf ( + fMakefile, + "endif\n\n" ); + } + } } string MingwModuleHandler::GenerateGccCommand ( const Module& module, - const string& sourceFilename, - const string& cc ) const + const string& sourceFilename, + const string& cc, + const string& cflagsMacro ) const { string objectFilename = GetObjectFilename ( sourceFilename ); return ssprintf ( "%s -c %s -o %s %s\n", cc.c_str (), sourceFilename.c_str (), objectFilename.c_str (), - GenerateGccParameters ( module ).c_str () ); + cflagsMacro.c_str () ); } string MingwModuleHandler::GenerateGccAssemblerCommand ( const Module& module, - const string& sourceFilename, - const string& cc ) const + const string& sourceFilename, + const string& cc, + const string& cflagsMacro ) const { string objectFilename = GetObjectFilename ( sourceFilename ); return ssprintf ( "%s -x assembler-with-cpp -c %s -o %s -D__ASM__ %s\n", - cc.c_str (), - sourceFilename.c_str (), - objectFilename.c_str (), - GenerateGccParameters ( module ).c_str () ); + cc.c_str (), + sourceFilename.c_str (), + objectFilename.c_str (), + cflagsMacro.c_str () ); } string MingwModuleHandler::GenerateNasmCommand ( const Module& module, - const string& sourceFilename ) const + const string& sourceFilename, + const string& nasmflagsMacro ) const { string objectFilename = GetObjectFilename ( sourceFilename ); return ssprintf ( "%s -f win32 %s -o %s %s\n", "nasm", sourceFilename.c_str (), objectFilename.c_str (), - GenerateNasmParameters ( module ).c_str () ); + nasmflagsMacro.c_str () ); } string MingwModuleHandler::GenerateCommand ( const Module& module, - const string& sourceFilename, - const string& cc ) const + const string& sourceFilename, + const string& cc, + const string& cflagsMacro, + const string& nasmflagsMacro ) const { string extension = GetExtension ( sourceFilename ); if ( extension == ".c" || extension == ".C" ) return GenerateGccCommand ( module, sourceFilename, - cc ); + cc, + cflagsMacro ); else if ( extension == ".s" || extension == ".S" ) return GenerateGccAssemblerCommand ( module, sourceFilename, - cc ); + cc, + cflagsMacro ); else if ( extension == ".asm" || extension == ".ASM" ) return GenerateNasmCommand ( module, - sourceFilename ); + sourceFilename, + nasmflagsMacro ); throw InvalidOperationException ( __FILE__, __LINE__, @@ -335,16 +438,17 @@ MingwModuleHandler::GenerateCommand ( const Module& module, void MingwModuleHandler::GenerateObjectFileTargets ( const Module& module, - const string& cc) const + const vector& files, + const string& cc, + const string& cflagsMacro, + const string& nasmflagsMacro ) const { - if ( module.files.size () == 0 ) + if ( files.size () == 0 ) return; - - GenerateGccModuleIncludeVariable ( module ); - for ( size_t i = 0; i < module.files.size (); i++ ) + for ( size_t i = 0; i < files.size (); i++ ) { - string sourceFilename = module.files[i]->name; + string sourceFilename = files[i]->name; string objectFilename = GetObjectFilename ( sourceFilename ); fprintf ( fMakefile, "%s: %s\n", @@ -354,58 +458,76 @@ MingwModuleHandler::GenerateObjectFileTargets ( const Module& module, "\t%s\n", GenerateCommand ( module, sourceFilename, - cc ).c_str () ); + cc, + cflagsMacro, + nasmflagsMacro ).c_str () ); } fprintf ( fMakefile, "\n" ); } void -MingwModuleHandler::GenerateObjectFileTargetsHost ( const Module& module ) const -{ - GenerateObjectFileTargets ( module, - "${host_gcc}" ); -} - -void -MingwModuleHandler::GenerateObjectFileTargetsTarget ( const Module& module ) const +MingwModuleHandler::GenerateObjectFileTargets ( const Module& module, + const string& cc, + const string& cflagsMacro, + const string& nasmflagsMacro ) const { - GenerateObjectFileTargets ( module, - "${gcc}" ); + GenerateObjectFileTargets ( module, module.files, cc, cflagsMacro, nasmflagsMacro ); + for ( size_t i = 0; i < module.ifs.size(); i++ ) + GenerateObjectFileTargets ( module, module.ifs[i]->files, cc, cflagsMacro, nasmflagsMacro ); } void MingwModuleHandler::GenerateArchiveTarget ( const Module& module, - const string& ar ) const + const string& ar, + const string& objs_macro ) const { string archiveFilename = GetModuleArchiveFilename ( module ); string sourceFilenames = GetSourceFilenames ( module ); - string objectsMacro = GenerateObjectList ( module ); fprintf ( fMakefile, "%s: %s\n", archiveFilename.c_str (), - objectsMacro.c_str ()); + objs_macro.c_str ()); fprintf ( fMakefile, "\t%s -rc %s %s\n\n", ar.c_str (), archiveFilename.c_str (), - objectsMacro.c_str ()); + objs_macro.c_str ()); } void -MingwModuleHandler::GenerateArchiveTargetHost ( const Module& module ) const +MingwModuleHandler::GenerateMacrosAndTargets ( + const Module& module, + const string& cc, + const string& ar ) const { - GenerateArchiveTarget ( module, - "${host_ar}" ); + string cflagsMacro = ssprintf("%s_CFLAGS",module.name.c_str()); + string nasmflagsMacro = ssprintf("%s_NASMFLAGS",module.name.c_str()); + string objectsMacro = ssprintf("%s_OBJS",module.name.c_str()); + + GenerateMacros ( module, cflagsMacro, nasmflagsMacro, objectsMacro ); + + // future references to the macros will be to get their values + cflagsMacro = ssprintf("$(%s)",cflagsMacro.c_str()); + nasmflagsMacro = ssprintf("$(%s)",nasmflagsMacro.c_str()); + objectsMacro = ssprintf("$(%s)",objectsMacro.c_str()); + + GenerateArchiveTarget ( module, ar, objectsMacro ); + GenerateObjectFileTargets ( module, cc, cflagsMacro, nasmflagsMacro ); } void -MingwModuleHandler::GenerateArchiveTargetTarget ( const Module& module ) const +MingwModuleHandler::GenerateMacrosAndTargetsHost ( const Module& module ) const { - GenerateArchiveTarget ( module, - "${ar}" ); + GenerateMacrosAndTargets ( module, "${host_gcc}", "${host_ar}" ); +} + +void +MingwModuleHandler::GenerateMacrosAndTargetsTarget ( const Module& module ) const +{ + GenerateMacrosAndTargets ( module, "${gcc}", "${ar}" ); } string @@ -513,28 +635,37 @@ MingwModuleHandler::GeneratePreconditionDependencies ( const Module& module ) co dependencies += s; } + fprintf ( fMakefile, + ".PHONY: %s\n\n", + preconditionDependenciesName.c_str () ); fprintf ( fMakefile, "%s: %s\n\n", preconditionDependenciesName.c_str (), dependencies.c_str () ); - fprintf ( fMakefile, - "%s: %s\n\n", - sourceFilenames.c_str (), - preconditionDependenciesName.c_str ()); - fprintf ( fMakefile, - ".PHONY: %s\n\n", - preconditionDependenciesName.c_str () ); -} - -string MingwModuleHandler::GenerateObjectList ( const Module& module ) const -{ - string macro ( ssprintf("%s_OBJS",module.name.c_str()) ); - fprintf ( - fMakefile, - "%s = %s\n", - macro.c_str(), - GetObjectFilenames(module).c_str() ); - return ssprintf("$(%s)",macro.c_str()); + const char* p = sourceFilenames.c_str(); + const char* end = p + strlen(p); + while ( p < end ) + { + const char* p2 = &p[512]; + if ( p2 > end ) + p2 = end; + while ( p2 > p && !isspace(*p2) ) + --p2; + if ( p == p2 ) + { + p2 = strpbrk ( p, " \t" ); + if ( !p2 ) + p2 = end; + } + fprintf ( fMakefile, + "%.*s: %s\n", + p2-p, + p, + preconditionDependenciesName.c_str ()); + p = p2; + p += strspn ( p, " \t" ); + } + fprintf ( fMakefile, "\n" ); } @@ -562,11 +693,10 @@ MingwBuildToolModuleHandler::GenerateBuildToolModuleTarget ( const Module& modul target.c_str (), archiveFilename.c_str () ); fprintf ( fMakefile, - "\t${host_gcc} -o %s %s\n", + "\t${host_gcc} -o %s %s\n\n", target.c_str (), archiveFilename.c_str () ); - GenerateArchiveTargetHost ( module ); - GenerateObjectFileTargetsHost ( module ); + GenerateMacrosAndTargetsHost ( module ); } static MingwKernelModuleHandler kernelmodule_handler; @@ -628,11 +758,10 @@ MingwKernelModuleHandler::GenerateKernelModuleTarget ( const Module& module ) archiveFilename.c_str (), importLibraryDependencies.c_str () ); fprintf ( fMakefile, - "\t${rm} %s\n", + "\t${rm} %s\n\n", temp_exp.c_str () ); - GenerateArchiveTargetTarget ( module ); - GenerateObjectFileTargetsTarget ( module ); + GenerateMacrosAndTargetsTarget ( module ); } @@ -654,8 +783,7 @@ MingwStaticLibraryModuleHandler::Process ( const Module& module ) void MingwStaticLibraryModuleHandler::GenerateStaticLibraryModuleTarget ( const Module& module ) { - GenerateArchiveTargetTarget ( module ); - GenerateObjectFileTargetsTarget ( module ); + GenerateMacrosAndTargetsTarget ( module ); } @@ -703,17 +831,16 @@ MingwKernelModeDLLModuleHandler::GenerateKernelModeDLLModuleTarget ( const Modul importLibraryDependencies.c_str () ); fprintf ( fMakefile, - "\t${gcc} -Wl,--subsystem,native -Wl,--entry,_DriverEntry@8 -Wl,--image-base,0x10000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -mdll -o %s %s %s\n", + "\t${gcc} -Wl,--subsystem,native -Wl,--entry,_DriverEntry@8 -Wl,--image-base,0x10000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -mdll -o %s %s %s\n\n", target.c_str (), archiveFilename.c_str (), importLibraryDependencies.c_str () ); - GenerateArchiveTargetTarget ( module ); - GenerateObjectFileTargetsTarget ( module ); + GenerateMacrosAndTargetsTarget ( module ); } else { - fprintf ( fMakefile, "%s:\n\n", + fprintf ( fMakefile, "%s:\n", target.c_str ()); fprintf ( fMakefile, ".PHONY: %s\n\n", target.c_str ()); @@ -765,13 +892,12 @@ MingwNativeDLLModuleHandler::GenerateNativeDLLModuleTarget ( const Module& modul importLibraryDependencies.c_str () ); fprintf ( fMakefile, - "\t${gcc} -Wl,--subsystem,native -Wl,--entry,_DllMainCRTStartup@12 -Wl,--image-base,0x10000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -nostdlib -mdll -o %s %s %s\n", + "\t${gcc} -Wl,--subsystem,native -Wl,--entry,_DllMainCRTStartup@12 -Wl,--image-base,0x10000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -nostdlib -mdll -o %s %s %s\n\n", target.c_str (), archiveFilename.c_str (), importLibraryDependencies.c_str () ); - GenerateArchiveTargetTarget ( module ); - GenerateObjectFileTargetsTarget ( module ); + GenerateMacrosAndTargetsTarget ( module ); } else { diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.h b/reactos/tools/rbuild/backend/mingw/modulehandler.h index d7bf6a5015e..d2715c77958 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.h +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.h @@ -30,15 +30,15 @@ protected: std::string GetObjectFilename ( const std::string& sourceFilename ) const; std::string GetObjectFilenames ( const Module& module ) const; - void GenerateObjectFileTargetsHost ( const Module& module ) const; - void GenerateObjectFileTargetsTarget ( const Module& module ) const; - void GenerateArchiveTargetHost ( const Module& module ) const; - void GenerateArchiveTargetTarget ( const Module& module ) const; + void GenerateMacrosAndTargetsHost ( const Module& module ) const; + void GenerateMacrosAndTargetsTarget ( const Module& module ) const; std::string GetInvocationDependencies ( const Module& module ) const; std::string GetInvocationParameters ( const Invoke& invoke ) const; void GenerateInvocations ( const Module& module ) const; void GeneratePreconditionDependencies ( const Module& module ) const; - std::string GenerateObjectList ( const Module& module ) const; + std::string GenerateMacros ( const Module& module, + const std::string& cflags_macro, + const std::string& objs_macro ) const; static FILE* fMakefile; private: std::string ConcatenatePaths ( const std::string& path1, @@ -46,25 +46,53 @@ private: std::string GenerateGccDefineParametersFromVector ( const std::vector& defines ) const; std::string GenerateGccDefineParameters ( const Module& module ) const; std::string GenerateGccIncludeParametersFromVector ( const std::vector& includes ) const; + void GenerateMacros ( const Module& module, + const char* op, + const std::vector& files, + const std::vector* includes, + const std::vector& defines, + const std::string& cflags_macro, + const std::string& nasmflags_macro, + const std::string& objs_macro) const; + void GenerateMacros ( const Module& module, + const std::string& cflags_macro, + const std::string& nasmflags_macro, + const std::string& objs_macro) const; void GenerateGccModuleIncludeVariable ( const Module& module ) const; std::string GenerateGccIncludeParameters ( const Module& module ) const; std::string GenerateGccParameters ( const Module& module ) const; std::string GenerateNasmParameters ( const Module& module ) const; std::string GenerateGccCommand ( const Module& module, const std::string& sourceFilename, - const std::string& cc ) const; + const std::string& cc, + const std::string& cflagsMacro ) const; std::string GenerateGccAssemblerCommand ( const Module& module, const std::string& sourceFilename, - const std::string& cc ) const; + const std::string& cc, + const std::string& cflagsMacro ) const; std::string GenerateNasmCommand ( const Module& module, - const std::string& sourceFilename ) const; + const std::string& sourceFilename, + const std::string& nasmflagsMacro ) const; std::string GenerateCommand ( const Module& module, const std::string& sourceFilename, - const std::string& cc ) const; + const std::string& cc, + const std::string& cflagsMacro, + const std::string& nasmflagsMacro ) const; void GenerateObjectFileTargets ( const Module& module, - const std::string& cc ) const; + const std::vector& files, + const std::string& cc, + const std::string& cflagsMacro, + const std::string& nasmflagsMacro ) const; + void GenerateObjectFileTargets ( const Module& module, + const std::string& cc, + const std::string& cflagsMacro, + const std::string& nasmflagsMacro ) const; void GenerateArchiveTarget ( const Module& module, - const std::string& ar ) const; + const std::string& ar, + const std::string& objs_macro ) const; + void GenerateMacrosAndTargets ( const Module& module, + const std::string& cc, + const std::string& ar ) const; std::string GetPreconditionDependenciesName ( const Module& module ) const; }; diff --git a/reactos/tools/rbuild/module.cpp b/reactos/tools/rbuild/module.cpp index fba4022ad92..125531f09c3 100644 --- a/reactos/tools/rbuild/module.cpp +++ b/reactos/tools/rbuild/module.cpp @@ -63,6 +63,8 @@ Module::~Module () delete invocations[i]; for ( i = 0; i < dependencies.size(); i++ ) delete dependencies[i]; + for ( i = 0; i < ifs.size(); i++ ) + delete ifs[i]; } void @@ -83,21 +85,32 @@ Module::ProcessXML() invocations[i]->ProcessXML (); for ( i = 0; i < dependencies.size(); i++ ) dependencies[i]->ProcessXML (); + for ( i = 0; i < ifs.size(); i++ ) + ifs[i]->ProcessXML(); } void Module::ProcessXMLSubElement ( const XMLElement& e, - const string& path ) + const string& path, + If* pIf /*= NULL*/ ) { bool subs_invalid = false; string subpath ( path ); if ( e.name == "file" && e.value.size () > 0 ) { - files.push_back ( new File ( FixSeparator ( path + CSEP + e.value ) ) ); + File* pFile = new File ( FixSeparator ( path + CSEP + e.value ) ); + if ( pIf ) + pIf->files.push_back ( pFile ); + else + files.push_back ( pFile ); subs_invalid = true; } else if ( e.name == "library" && e.value.size () ) { + if ( pIf ) + throw InvalidBuildFileException ( + e.location, + " is not a valid sub-element of " ); libraries.push_back ( new Library ( e, *this, e.value ) ); subs_invalid = true; } @@ -109,36 +122,66 @@ Module::ProcessXMLSubElement ( const XMLElement& e, } else if ( e.name == "include" ) { + if ( pIf ) + throw InvalidBuildFileException ( + e.location, + " is not a valid sub-element of " ); includes.push_back ( new Include ( project, this, e ) ); subs_invalid = true; } else if ( e.name == "define" ) { - defines.push_back ( new Define ( project, this, e ) ); + Define* pDefine = new Define ( project, this, e ); + if ( pIf ) + pIf->defines.push_back ( pDefine ); + else + defines.push_back ( pDefine ); subs_invalid = true; } else if ( e.name == "invoke" ) { + if ( pIf ) + throw InvalidBuildFileException ( + e.location, + " is not a valid sub-element of " ); invocations.push_back ( new Invoke ( e, *this ) ); subs_invalid = false; } else if ( e.name == "dependency" ) { + if ( pIf ) + throw InvalidBuildFileException ( + e.location, + " is not a valid sub-element of " ); dependencies.push_back ( new Dependency ( e, *this ) ); subs_invalid = true; } else if ( e.name == "importlibrary" ) { + if ( pIf ) + throw InvalidBuildFileException ( + e.location, + " is not a valid sub-element of " ); + if ( importLibrary ) + throw InvalidBuildFileException ( + e.location, + "Only one is valid per module" ); importLibrary = new ImportLibrary ( e, *this ); subs_invalid = true; } + else if ( e.name == "if" ) + { + pIf = new If ( e, *this ); + ifs.push_back ( pIf ); + subs_invalid = false; + } if ( subs_invalid && e.subElements.size() > 0 ) throw InvalidBuildFileException ( e.location, "<%s> cannot have sub-elements", e.name.c_str() ); for ( size_t i = 0; i < e.subElements.size (); i++ ) - ProcessXMLSubElement ( *e.subElements[i], subpath ); + ProcessXMLSubElement ( *e.subElements[i], subpath, pIf ); } ModuleType @@ -188,14 +231,23 @@ Module::GetTargetName () const string Module::GetDependencyPath () const { - if ( type == KernelModeDLL ) + switch ( type ) + { + case KernelModeDLL: return ssprintf ( "dk%snkm%slib%slib%s.a", SSEP, SSEP, SSEP, name.c_str () ); - else - return GetPath (); + case NativeDLL: + return ssprintf ( "dk%sw32%slib%slib%s.a", + SSEP, + SSEP, + SSEP, + name.c_str () ); + default: + return GetPath(); + } } string @@ -425,5 +477,36 @@ ImportLibrary::ImportLibrary ( const XMLElement& _node, att = _node.GetAttribute ( "definition", true ); assert (att); - definition = att->value; + definition = FixSeparator(att->value); +} + + +If::If ( const XMLElement& node_, const Module& module_ ) + : node(node_), module(module_) +{ + const XMLAttribute* att; + + att = node.GetAttribute ( "property", true ); + assert(att); + property = att->value; + + att = node.GetAttribute ( "value", true ); + assert(att); + value = att->value; +} + +If::~If () +{ + size_t i; + for ( i = 0; i < files.size(); i++ ) + delete files[i]; + for ( i = 0; i < defines.size(); i++ ) + delete defines[i]; + for ( i = 0; i < ifs.size(); i++ ) + delete ifs[i]; +} + +void +If::ProcessXML() +{ } diff --git a/reactos/tools/rbuild/rbuild.h b/reactos/tools/rbuild/rbuild.h index 8411a35d8b3..cde527be227 100644 --- a/reactos/tools/rbuild/rbuild.h +++ b/reactos/tools/rbuild/rbuild.h @@ -31,6 +31,7 @@ class Invoke; class InvokeFile; class Dependency; class ImportLibrary; +class If; class Project { @@ -86,6 +87,7 @@ public: std::vector defines; std::vector invocations; std::vector dependencies; + std::vector ifs; Module ( const Project& project, const XMLElement& moduleNode, @@ -104,7 +106,8 @@ public: private: std::string GetDefaultModuleExtension () const; void ProcessXMLSubElement ( const XMLElement& e, - const std::string& path ); + const std::string& path, + If* pIf = NULL ); }; @@ -239,6 +242,23 @@ public: void ProcessXML (); }; +class If +{ +public: + const XMLElement& node; + const Module& module; + std::string property, value; + std::vector files; + std::vector defines; + std::vector ifs; + + If ( const XMLElement& node_, + const Module& module_ ); + ~If(); + + void ProcessXML(); +}; + extern std::string FixSeparator ( const std::string& s ); -- 2.17.1