Skip to content

Commit

Permalink
Support name and value entries in flag specifications.
Browse files Browse the repository at this point in the history
  • Loading branch information
hughsando committed Aug 28, 2024
1 parent 615cf5d commit 01ef3fa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion toolchain/haxe-target.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<xml>

<!-- make sure hxcpp.n is up to date -->
<pleaseUpdateHxcppTool version="4" />
<pleaseUpdateHxcppTool version="5" />

<pragma once="true" />

Expand Down
31 changes: 22 additions & 9 deletions tools/hxcpp/BuildTool.hx
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,11 @@ class BuildTool
if (valid(el,""))
switch(el.name)
{
case "flag" : c.addFlag(substitute(el.att.value), el.has.tag?substitute(el.att.tag):"");
case "flag" :
var tag = el.has.tag?substitute(el.att.tag):"";
if (el.has.name)
c.addFlag(substitute(el.att.name), tag);
c.addFlag(substitute(el.att.value), tag);
case "cflag" : c.mCFlags.push(substitute(el.att.value));
case "cppflag" : c.mCPPFlags.push(substitute(el.att.value));
case "objcflag" : c.mOBJCFlags.push(substitute(el.att.value));
Expand Down Expand Up @@ -1090,7 +1094,10 @@ class BuildTool
if (valid(el,""))
switch(el.name)
{
case "flag" : l.mFlags.push(substitute(el.att.value));
case "flag" :
if (el.has.name)
l.mFlags.push(substitute(el.att.name));
l.mFlags.push(substitute(el.att.value));
case "ext" : l.mExt = (substitute(el.att.value));
case "outflag" : l.mOutFlag = (substitute(el.att.value));
case "libdir" : l.mLibDir = (substitute(el.att.name));
Expand Down Expand Up @@ -1150,17 +1157,17 @@ class BuildTool
if (valid(el,""))
switch(el.name)
{
case "flag" : s.mFlags.push(substitute(el.att.value));
case "outPre" : s.mOutPre = substitute(el.att.value);
case "outPost" : s.mOutPost = substitute(el.att.value);
case "flag" :
if (el.has.name)
s.mFlags.push(substitute(el.att.name));
s.mFlags.push(substitute(el.att.value));
case "exe" : s.mExe = substitute((el.att.name));
}
}

return s;
}


public function createStripper(inXML:XmlAccess,inBase:Stripper):Stripper
{
var s = (inBase!=null && !inXML.has.replace) ? inBase :
Expand All @@ -1170,7 +1177,10 @@ class BuildTool
if (valid(el,""))
switch(el.name)
{
case "flag" : s.mFlags.push(substitute(el.att.value));
case "flag" :
if (el.has.name)
s.mFlags.push(substitute(el.att.name));
s.mFlags.push(substitute(el.att.value));
case "exe" : s.mExe = substitute((el.att.name));
}
}
Expand Down Expand Up @@ -1238,7 +1248,10 @@ class BuildTool
target.mLibs.push(lib);
}

case "flag" : target.mFlags.push( substitute(el.att.value) );
case "flag" :
if (el.has.name)
target.mFlags.push( substitute(el.att.name) );
target.mFlags.push( substitute(el.att.value) );
case "depend" : target.mDepends.push( substitute(el.att.name) );
case "vflag" :
target.mFlags.push( substitute(el.att.name) );
Expand Down Expand Up @@ -2334,7 +2347,7 @@ class BuildTool
public function checkToolVersion(inVersion:String)
{
var ver = Std.parseInt(inVersion);
if (ver>4)
if (ver>5)
Log.error("Your version of hxcpp.n is out-of-date. Please update by compiling 'haxe compile.hxml' in hxcpp/tools/hxcpp.");
}

Expand Down

0 comments on commit 01ef3fa

Please sign in to comment.