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
absolute-pathPrint absolute file path in trace output
advanced-telemetryAllow the SWF to be measured with Monocle tool
analyzerUse static analyzer for optimization (experimental)
as3Defined when outputing flash9 as3 source code
check-xml-proxyCheck the used fields of the xml proxy
core-apiDefined in the core api context
core-api-serializeMark some generated core api classes with the Serializable attribute on C#
cppiaGenerate experimental cpp instruction assembly
dce=<mode:std|full|no>Set the dead code elimination mode (default std)
dce-debugShow dead code elimination log
debugActivated when compiling with -debug
displayActivated during completion
dll-exportGenCPP experimental linking
dll-importGenCPP experimental linking
doc-genDo not perform any removal/change in order to correctly generate documentation
dumpDump the complete typed AST for internal debugging in a dump subdirectory - use dump=pretty for Haxe-like formatting
dump-dependenciesDump the classes dependencies in a dump subdirectory
dump-ignore-var-idsRemove variable IDs from non-pretty dumps (helps with diff)
erase-genericsErase generic classes on C#
fdbEnable full flash debug infos for FDB interactive debugging
file-extensionOutput filename extension for cpp source code
flash-strictMore strict typing for flash target
flash-use-stageKeep the SWF library initial stage
force-lib-checkForce the compiler to check -net-lib and -java-lib added classes (internal)
force-native-propertyTag all properties with :nativeProperty metadata for 3.1 compatibility
format-warningPrint a warning for each formated string, for 2.x compatibility
gencommon-debugGenCommon internal
haxe-bootGiven the name 'haxe' to the flash boot class instead of a generated name
haxe-verThe current Haxe version value
hxcpp-api-levelProvided to allow compatibility between hxcpp versions
include-prefixprepend path to generated include files
interpThe code is compiled to be run with --interp
java-ver=[version:5-7]Sets the Java version to be targeted
js-classicDon't use a function wrapper and strict mode in JS output
js-es5Generate JS for ES5-compliant runtimes
js-unflattenGenerate nested objects for packages and types
keep-old-outputKeep old source files in the output directory (for C#/Java)
loop-unroll-max-costMaximum cost (number of expressions * iterations) before loop unrolling is canceled (default 250)
macroDefined when code is compiled in the macro context
macro-timesDisplay 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-sourceOutput neko source instead of bytecode
neko-v1Keep Neko 1.x compatibility
network-sandboxUse local network sandbox instead of local file access one
no-compilationDisable CPP final compilation
no-coptDisable completion optimization (for debug purposes)
no-debugRemove all debug macros from cpp output
no-deprecation-warningsDo not warn if fields annotated with @:deprecated are used
no-flash-overrideChange overrides on some basic classes into HX suffixed methods flash only
no-optDisable optimizations
no-pattern-matchingDisable pattern matching
no-inlineDisable inlining
no-rootGenCS internal
no-macro-cacheDisable macro context caching
no-simplifyDisable simplification filter
no-swf-compressDisable SWF output compression
no-tracesDisable all trace calls
php-prefixCompiled with --php-prefix
real-positionDisables haxe source mapping when targetting C#
replace-filesGenCommon internal
scriptableGenCPP internal
shallow-exposeExpose types to surrounding scope of Haxe generated closure without writing to window object
source-map-contentInclude the hx sources as part of the JS source map
swcOutput 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-blitUse hardware acceleration to blit graphics
swf-gpuUse GPU compositing features when drawing graphics
swf-metadata=<file.xml>Include contents of <file.xml> as metadata in the swf.
swf-preloader-frameInsert empty first frame in swf. To be used together with -D flash-use-stage and -swf-lib
swf-protectedCompile Haxe private as protected in the SWF instead of public
swf-script-timeoutMaximum ActionScript processing time before script stuck dialog box displays (in seconds)
swf-use-doabcUse DoAbc swf-tag instead of DoAbcDefine
sysDefined for all system platforms
unsafeAllow unsafe code when targeting C#
use-nekocUse nekoc compiler instead of internal one
use-rtti-docAllows access to documentation during compilation
vcprojGenCPP internal