7.1 Global Compiler Flags

Starting from Haxe 3.0, you can get the list of supported compiler flags by running haxe --help-defines

Global Compiler Flags
Flag Description
absolute-path Print absolute file path in trace output
advanced-telemetry Allow the SWF to be measured with Monocle tool
analyzer Use static analyzer for optimization (experimental)
as3 Defined when outputing flash9 as3 source code
check-xml-proxy Check the used fields of the xml proxy
core-api Defined in the core api context
core-api-serialize Mark some generated core api classes with the Serializable attribute on C#
cppia Generate experimental cpp instruction assembly
dce=<mode:std|full|no> Set the dead code elimination mode (default std)
dce-debug Show dead code elimination log
debug Activated when compiling with -debug
display Activated during completion
dll-export GenCPP experimental linking
dll-import GenCPP experimental linking
doc-gen Do not perform any removal/change in order to correctly generate documentation
dump Dump the complete typed AST for internal debugging in a dump subdirectory - use dump=pretty for Haxe-like formatting
dump-dependencies Dump the classes dependencies in a dump subdirectory
dump-ignore-var-ids Remove variable IDs from non-pretty dumps (helps with diff)
erase-generics Erase generic classes on C#
fdb Enable full flash debug infos for FDB interactive debugging
file-extension Output filename extension for cpp source code
flash-strict More strict typing for flash target
flash-use-stage Keep the SWF library initial stage
force-lib-check Force the compiler to check -net-lib and -java-lib added classes (internal)
force-native-property Tag all properties with :nativeProperty metadata for 3.1 compatibility
format-warning Print a warning for each formated string, for 2.x compatibility
gencommon-debug GenCommon internal
haxe-boot Given the name 'haxe' to the flash boot class instead of a generated name
haxe-ver The current Haxe version value
hxcpp-api-level Provided to allow compatibility between hxcpp versions
include-prefix prepend path to generated include files
interp The code is compiled to be run with --interp
java-ver=[version:5-7] Sets the Java version to be targeted
js-classic Don't use a function wrapper and strict mode in JS output
js-es5 Generate JS for ES5-compliant runtimes
js-unflatten Generate nested objects for packages and types
keep-old-output Keep old source files in the output directory (for C#/Java)
loop-unroll-max-cost Maximum cost (number of expressions * iterations) before loop unrolling is canceled (default 250)
macro Defined when code is compiled in the macro context
macro-times Display per-macro timing when used with --times
net-ver=<version:20-45> Sets the .NET version to be targeted
net-target=<name> Sets the .NET target. Defaults to net. xbox, micro (Micro Framework, compact (Compact Framework) are some valid values
neko-source Output neko source instead of bytecode
neko-v1 Keep Neko 1.x compatibility
network-sandbox Use local network sandbox instead of local file access one
no-compilation Disable CPP final compilation
no-copt Disable completion optimization (for debug purposes)
no-debug Remove all debug macros from cpp output
no-deprecation-warnings Do not warn if fields annotated with <code>@:deprecated</code> are used
no-flash-override Change overrides on some basic classes into HX suffixed methods flash only
no-opt Disable optimizations
no-pattern-matching Disable pattern matching
no-inline Disable inlining
no-root GenCS internal
no-macro-cache Disable macro context caching
no-simplify Disable simplification filter
no-swf-compress Disable SWF output compression
no-traces Disable all trace calls
php-prefix Compiled with --php-prefix
real-position Disables haxe source mapping when targetting C#
replace-files GenCommon internal
scriptable GenCPP internal
shallow-expose Expose types to surrounding scope of Haxe generated closure without writing to window object
source-map-content Include the hx sources as part of the JS source map
swc Output a SWC instead of a SWF
swf-compress-level=<level:1-9> Set the amount of compression for the SWF output
swf-debug-password=<yourPassword> Set a password for debugging. The password field is encrypted by using the MD5 algorithm and prevents unauthorised debugging of your swf. Without this flag -D fdb will use no password.
swf-direct-blit Use hardware acceleration to blit graphics
swf-gpu Use GPU compositing features when drawing graphics
swf-metadata=<file.xml> Include contents of <file.xml> as metadata in the swf.
swf-preloader-frame Insert empty first frame in swf. To be used together with -D flash-use-stage and -swf-lib
swf-protected Compile Haxe private as protected in the SWF instead of public
swf-script-timeout Maximum ActionScript processing time before script stuck dialog box displays (in seconds)
swf-use-doabc Use DoAbc swf-tag instead of DoAbcDefine
sys Defined for all system platforms
unsafe Allow unsafe code when targeting C#
use-nekoc Use nekoc compiler instead of internal one
use-rtti-doc Allows access to documentation during compilation
vcproj GenCPP internal