From e5eeaef2d236d26962fd99ba3cb9634cc88e3f90 Mon Sep 17 00:00:00 2001 From: Marc Piulachs Date: Thu, 15 May 2008 13:55:25 +0000 Subject: [PATCH] - Added a new attribute 'internal' to 'Property' element. Internal properties are like regular properties but internal to rbuild (they are not included in the generated makefile) svn path=/trunk/; revision=33526 --- reactos/tools/rbuild/backend/mingw/mingw.cpp | 10 +++++++--- reactos/tools/rbuild/module.cpp | 19 +++++++++++++++++++ reactos/tools/rbuild/rbuild.h | 1 + 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/reactos/tools/rbuild/backend/mingw/mingw.cpp b/reactos/tools/rbuild/backend/mingw/mingw.cpp index 161e7007dd8..56c5033e35b 100644 --- a/reactos/tools/rbuild/backend/mingw/mingw.cpp +++ b/reactos/tools/rbuild/backend/mingw/mingw.cpp @@ -401,9 +401,13 @@ MingwBackend::GenerateGlobalCFlagsAndProperties ( for ( i = 0; i < data.properties.size(); i++ ) { Property& prop = *data.properties[i]; - fprintf ( fMakefile, "%s := %s\n", - prop.name.c_str(), - prop.value.c_str() ); + + if (!prop.isInternal) + { + fprintf ( fMakefile, "%s := %s\n", + prop.name.c_str(), + prop.value.c_str() ); + } } if ( data.includes.size() || data.defines.size() ) diff --git a/reactos/tools/rbuild/module.cpp b/reactos/tools/rbuild/module.cpp index a69288a152a..812638f4fd5 100644 --- a/reactos/tools/rbuild/module.cpp +++ b/reactos/tools/rbuild/module.cpp @@ -1705,6 +1705,25 @@ Property::Property ( const XMLElement& node_, att = node_.GetAttribute ( "value", true ); assert(att); value = att->value; + + att = node_.GetAttribute ( "internal", false ); + if ( att != NULL ) + { + const char* p = att->value.c_str(); + if ( !stricmp ( p, "true" ) || !stricmp ( p, "yes" ) ) + isInternal = true; + else if ( !stricmp ( p, "false" ) || !stricmp ( p, "no" ) ) + isInternal = false; + else + { + throw InvalidAttributeValueException ( + node_.location, + "internal", + att->value ); + } + } + else + isInternal = false; } Property::Property ( const Project& project_, diff --git a/reactos/tools/rbuild/rbuild.h b/reactos/tools/rbuild/rbuild.h index 1b6adba0832..e7a5b28735d 100644 --- a/reactos/tools/rbuild/rbuild.h +++ b/reactos/tools/rbuild/rbuild.h @@ -658,6 +658,7 @@ public: const Project& project; const Module* module; std::string name, value; + bool isInternal; Property ( const XMLElement& node_, const Project& project_,