2025-01-22 16:18:30 +01:00

4.1 KiB
Executable File

Structure of the top-level

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

  • set - Set 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 - Unset 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 - Print value to console. Good for debugging.

    <echo value="text" />
    
  • error - Print value to console and force 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 - Add an directory to the exe search path.

    <path name="directory_to_add" />
    
  • mkdir - Create a directory.

    <mkdir name="directory" />
    
  • section - Groups block of elements - usually ones that all respect the same if/unless condition.

    <section name="id" />  </section>
    
  • copy - Copy file when node is parsed.

    <copy to="destination" from="src" />
    
  • import/include - Read xml from another file. 'import' resets the relative base to the new file, include does not.

    <import name="filename" section="filter" noerror="true" />
    <include name="filename" section="filter" noerror="true" />
    
    • noerror - setting the optional noerror allows the file to be missing
    • section - setting the optional section will only read the named section from the xml file. Used by hxcpp_config.xml.
  • pragma - Only include build file once, even with multiple include statements.

    <pragma once="true" />
    
  • nvccflag - Add flag to all nvcc compiles.

    <nvccflag name="?name" value="-IincludePath" />
    
  • nvcclinkflag - Add flag when linking with nvcc code.

    <nvcclinkflag name="?name" value="-arch=sm_30" />
    
  • files - Define a file group, and set default tags.

    <files dir="dir" name="name" tags="tag1,tag2,tag3" >
     ...
    </files>
    
    • dir = directory to which the filenames in the group are relative
    • tags = comma separated list of flags tags
  • target - Define a target, and set its toolid(link mode) and output name.

    <target name="name" overwrite="true" append="true" tool="linker" toolid="${haxelink}" output="filename" >
     ...
    </target>
    
  • copyFile - Copy a file after given toolId is run into target output directory

    <copyFile name="destination" from="src" allowMissing="true" overwrite="true" toolId="filter" >
    
  • magiclib - Internal for replacing dlls with object files

    <magiclib name="libname" replace="old dll" />
    
  • compiler - Define a compiler.

    <compiler id="id" exe="command" replace="true" >
     ...
    </compiler>
    
    • Use optional 'replace' to overwrite, otherwise append
    • It is assumed only 1 compiler is active
    • exe can be overridden in the body of the definition
  • stripper - Define a stripper, to remove debug information for release from gcc executables

    <stripper exe="command" replace="true" > </stripper>
    
    • Use optional 'replace' to overwrite, otherwise append
  • linker - Define a linker.

    <linker id="id" exe="command" replace="true" > </linker>
    
    • Use optional 'replace' to overwrite, otherwise append
    • id could be 'static_link', 'dll' or 'exe'. Usually all 3 linkers are defined.
    • exe can be overridden in the body of the definition
  • prelinker - Define a prelinker.

    <prelinker name="id" replace="true" />
     ...
    </prelinker>