Structure of the top-level

The top-level nodes live inside an <xml> node, and can be:

  • set - Sets a "define", define being a general variable.
<set name="name" value="1" />
  • setenv - Sets an hxcpp define and an environment variable for child processes.
<setenv name="name" value="1" />
  • unset - Unsets a define. if="name" will no longer be true.
<unset name="name" />
  • setup - Used internally to call custom setup code to find SDKs etc.
<setup name="androidNdk|blackberry|msvc|pdbserver|mingw|emscripten|nvcc" />
  • echo - Prints a value to console. Good for debugging.
<echo value="text" />
  • error - Prints a value to console and forces an error. Good for checking prerequisites.
<error value="error message" />
  • pleaseUpdateHxcppTool - Used to tell people updating git version that they need to recompile the build tool.
<pleaseUpdateHxcppTool version="1" />
  • path - Adds a directory to the exe search path.
<path name="directory_to_add" />
  • mkdir - Creates a directory.
<mkdir name="directory" />
  • section - Groups blocks of elements - usually ones that all respect the same if/unless condition.
<section name="id" />...</section>
  • copy - Copies a file when the node is parsed.
<copy to="destination" from="src" />
  • import/include - Reads XML from another file. import resets the relative base to the new file, include does not.

    • noerror - when true, allows the file to be missing. (optional)
    • section - only read the named section from the XML file. Used by hxcpp_config.xml. (optional)
<import name="filename" section="filter" noerror="true" />
<include name="filename" section="filter" noerror="true" />
  • pragma - Only include build file once, even with multiple include statements.
<pragma once="true" />
  • nvccflag - Adds flag to all nvcc compiles.
<nvccflag name="?name" value="-IincludePath" />
  • nvcclinkflag - Adds flag when linking with nvcc code.
<nvcclinkflag name="?name" value="-arch=sm_30" />
  • files - Defines a file group, and sets default tags.

    • dir - directory to which the filenames in the group are relative.
    • tags - comma-separated list of tags.
<files dir="dir" name="name" tags="tag1,tag2,tag3" >...</files>
  • target - Defines a target, and sets its toolid (link mode) and output name.
<target name="name" overwrite="true" append="true" tool="linker" toolid="${haxelink}" output="filename">...</target>
  • copyFile - Copies a file after the given toolId is run into target output directory.
<copyFile name="destination" from="src" allowMissing="true" overwrite="true" toolId="filter" />
  • magiclib - Internally used for replacing DLLs with object files.
<magiclib name="libname" replace="old dll" />
  • compiler - Defines a compiler. It is assumed only 1 compiler is active.

    • replace - when true the compiler is overridden, otherwise the contents of this node are appended to an existing compiler with the same id. (optional)
    • exe - can be overridden in the body of the definition.
<compiler id="id" exe="command" replace="true">...</compiler>
  • stripper - Defines a stripper, used to remove debug information for release from gcc executables.

    • replace - when true overwrites, otherwise appends. (optional)
<stripper exe="command" replace="true">...</stripper>
  • linker - Defines a linker.

    • replace - when true overwrites, otherwise appends. (optional)
    • id - can be static_link, dll, or exe. Usually all 3 linkers are defined.
    • exe - can be overridden in the body of the definition.
<linker id="id" exe="command" replace="true">...</linker>
  • prelinker - Defines a prelinker.

    • replace - when true overwrites, otherwise appends.
<prelinker name="id" replace="true" />...</prelinker>