diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp index 074c2722d69..e167eac4829 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp @@ -731,7 +731,8 @@ MingwModuleHandler::GenerateMacros ( { fprintf ( fMakefile, - "ifeq (\"$(%s)\",\"%s\")\n", + "%s (\"$(%s)\",\"%s\")\n", + rIf.negated ? "ifneq" : "ifeq", rIf.property.c_str(), rIf.value.c_str() ); GenerateMacros ( @@ -815,7 +816,8 @@ MingwModuleHandler::GenerateObjectMacros ( { fprintf ( fMakefile, - "ifeq (\"$(%s)\",\"%s\")\n", + "%s (\"$(%s)\",\"%s\")\n", + rIf.negated ? "ifneq" : "ifeq", rIf.property.c_str(), rIf.value.c_str() ); GenerateObjectMacros ( diff --git a/reactos/tools/rbuild/module.cpp b/reactos/tools/rbuild/module.cpp index b7bdbc281fb..3b833156132 100644 --- a/reactos/tools/rbuild/module.cpp +++ b/reactos/tools/rbuild/module.cpp @@ -424,6 +424,16 @@ Module::ProcessXMLSubElement ( const XMLElement& e, non_if_data.ifs.push_back ( pIf ); subs_invalid = false; } + else if ( e.name == "ifnot" ) + { + If* pOldIf = pIf; + pIf = new If ( e, project, this, true ); + if ( pOldIf ) + pOldIf->data.ifs.push_back ( pIf ); + else + non_if_data.ifs.push_back ( pIf ); + subs_invalid = false; + } else if ( e.name == "compilerflag" ) { CompilerFlag* pCompilerFlag = new CompilerFlag ( project, this, e ); @@ -1014,8 +1024,9 @@ ImportLibrary::ImportLibrary ( const XMLElement& _node, If::If ( const XMLElement& node_, const Project& project_, - const Module* module_ ) - : node(node_), project(project_), module(module_) + const Module* module_, + const bool negated_ ) + : node(node_), project(project_), module(module_), negated(negated_) { const XMLAttribute* att; diff --git a/reactos/tools/rbuild/project.cpp b/reactos/tools/rbuild/project.cpp index 19d7ed622e6..464626aa311 100644 --- a/reactos/tools/rbuild/project.cpp +++ b/reactos/tools/rbuild/project.cpp @@ -330,6 +330,16 @@ Project::ProcessXMLSubElement ( const XMLElement& e, non_if_data.ifs.push_back ( pIf ); subs_invalid = false; } + else if ( e.name == "ifnot" ) + { + If* pOldIf = pIf; + pIf = new If ( e, *this, NULL, true ); + if ( pOldIf ) + pOldIf->data.ifs.push_back ( pIf ); + else + non_if_data.ifs.push_back ( pIf ); + subs_invalid = false; + } else if ( e.name == "property" ) { Property* property = new Property ( e, *this, NULL ); diff --git a/reactos/tools/rbuild/rbuild.h b/reactos/tools/rbuild/rbuild.h index bc1e14bc65e..96b86c85aee 100644 --- a/reactos/tools/rbuild/rbuild.h +++ b/reactos/tools/rbuild/rbuild.h @@ -395,12 +395,14 @@ public: const XMLElement& node; const Project& project; const Module* module; + const bool negated; std::string property, value; IfableData data; If ( const XMLElement& node_, const Project& project_, - const Module* module_ ); + const Module* module_, + const bool negated_ = false ); ~If(); void ProcessXML();