Skip to content

Commit

Permalink
Add 'set' with no name to dump current values. Check for undefined va…
Browse files Browse the repository at this point in the history
…lues when linking android
  • Loading branch information
Hugh Sanderson committed Oct 6, 2024
1 parent 5ed5825 commit 66b8f88
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
3 changes: 3 additions & 0 deletions toolchain/android-toolchain-clang.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
<flag value ="-shared" />
<flag value="--target=${ABITRIPLE}${PLATFORM_NUMBER}" />

<!-- Build time error, not run time -->
<flag value="-Wl,--no-undefined" unless="HXCPP_ALLOW_UNDEFINED" />

<flag value ="-static-libstdc++" />
<!-- This shows the android link line, which may be so long that it breaks the tool
https://github.com/HaxeFoundation/hxcpp/pull/1091
Expand Down
18 changes: 15 additions & 3 deletions tools/hxcpp/BuildTool.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2216,6 +2216,13 @@ class BuildTool
}
}

function dumpDefs()
{
Sys.println("Defines:");
for(k in mDefines.keys())
Sys.println(' $k=${mDefines.get(k)}');
}

function parseXML(inXML:XmlAccess,inSection:String, forceRelative:Bool)
{
for(el in inXML.elements)
Expand All @@ -2225,9 +2232,14 @@ class BuildTool
switch(el.name)
{
case "set" :
var name = substitute(el.att.name);
var value = substitute(el.att.value);
mDefines.set(name,value);
if (el.has.name)
{
var name = substitute(el.att.name);
var value = substitute(el.att.value);
mDefines.set(name,value);
}
else
dumpDefs();
case "unset" :
var name = substitute(el.att.name);
mDefines.remove(name);
Expand Down

0 comments on commit 66b8f88

Please sign in to comment.