haXe Compiler

Command Line Arguments

Here is a list of the different arguments that you are able to pass to the HaXe compiler.

These arguments can also be placed into a text file of one per line with the extension hxml. This file can then be passed directly to the haxe compiler as a build script.

Targets

These are the different targets and options provided with HaXe 2.04.

Each target and it's options may only be used once per call the compiler. --next can be used in hxml files to utilize multiple calls with one command.

C++

See: hxcpp for more information on setting up your environment to compile the C++ files.

  • —cpp : compile code to C++ files

Javascript

See: Getting started with haXe/JS.

  • —js : compile code to JavaScript file

Neko

See: Getting started with haXe/Neko.

  • —neko : compile code to Neko Binary
  • —x : shortcut for compiling and executing a neko file
  • ——neko—source : keep generated neko source

Flash

See: Getting started with haXe/Flash.

  • —as3 : generate AS3 code into target directory
  • —swf : compile code to Flash SWF file
  • —swf9 : compile code to Flash9 SWF file
  • —swf—version : change the SWF version (6 to 10). Implies the `-D flashN` switch, where `N` is the SWF version specified
  • —swf—header : define SWF header (width:height:fps:color)
  • —swf—lib : add the SWF library to the compiled SWF
  • ——flash—strict : more type strict flash API
  • ——flash—use—stage : place objects found on the stage of the SWF lib

PHP

See: Getting started with haXe/PHP.

  • —php : generate PHP code into target directory
  • ——php—front : select the name for the PHP front file

XML

  • —xml : generate XML types description

Compilation Options

  • —main : select startup class
  • —lib : use an haxelib library
  • —D : define a conditional compilation flag
    See: Conditional Compilation
  • —resource [@name] : add a named resource file
  • —exclude : don’t generate code for classes listed in this file
  • —debug : add debug information to the compiled code
  • ——no—opt : disable code optimizations
  • ——no—traces : don’t compile trace calls in the program
  • —-no—inline : disable inlining
  • ——remap : remap a package to another one
  • —cp : add a directory to find source files

Compiler Interaction Options

  • ——display : display code tips
  • —v : turn on verbose node
  • —prompt : prompt on error
  • ——times : measure compilation times
  • —help : Display this list of options
  • ——help : Display this list of options

Batch Processing Commands

  • —cmd : run the specified command after successful compilation (Note: will only run after a successful compile. Will not run without a target)
  • ——gen—hx—classes : generate hx headers from SWF9 file
  • ——next : separate several haxe compilations
  • ——no—output : compiles but does not generate any file
version #8223, modified 2010-03-17 12:59:23 by amn