- add option to macro to specify for which backend this macro is intended

If the macro is for all backends, then you dont need to set this option
However, if this macro is for gcc only then put an option, i.e.:
<define name="__USE_W32API" backend="mingw" />

for msvc backend set backend="msvc"
-Currently filtering is only implemented for msvc backend

svn path=/trunk/; revision=27303
This commit is contained in:
Johannes Anderwald
2007-06-28 10:03:54 +00:00
parent 13e2fd4bc6
commit e129100556
3 changed files with 12 additions and 3 deletions
@@ -195,6 +195,9 @@ MSVCBackend::_generate_vcproj ( const Module& module )
const vector<Define*>& defs = data.defines;
for ( i = 0; i < defs.size(); i++ )
{
if ( defs[i]->backend != "" && defs[i]->backend != "msvc" )
continue;
if ( defs[i]->value[0] )
common_defines.insert( defs[i]->name + "=" + defs[i]->value );
else
+6 -2
View File
@@ -44,13 +44,15 @@ Define::Define ( const Project& project,
Define::Define ( const Project& project,
const Module* module,
const std::string name_ )
const std::string name_,
const std::string backend_)
: project(project),
module(module),
node(NULL)
{
name = name_;
value = "";
backend = backend_;
}
Define::~Define ()
@@ -62,9 +64,11 @@ Define::Initialize()
{
const XMLAttribute* att = node->GetAttribute ( "name", true );
const XMLAttribute* empty = node->GetAttribute ( "empty", false );
const XMLAttribute* bck = node->GetAttribute ( "backend", false );
assert(att);
name = att->value;
value = node->value;
value = node->value;
if ( bck ) backend = bck->value;
if( empty ) value = " ";
}
+3 -1
View File
@@ -390,6 +390,7 @@ public:
const XMLElement* node;
std::string name;
std::string value;
std::string backend;
Define ( const Project& project,
const XMLElement& defineNode );
@@ -398,7 +399,8 @@ public:
const XMLElement& defineNode );
Define ( const Project& project,
const Module* module,
const std::string name_ );
const std::string name_,
const std::string backend_ = "" );
~Define();
void ProcessXML();
private: