12
2026
05

haxe-D参数

执行下面命令查看haxe -D都可以指定那些参数。 

haxe --help-defines

 HXCPP-DEBUGGER            : Include additional information for hxcpp-debugger.

                             (cpp only)

 HXCPP-GC-GENERATIONAL     : Experimental Garbage Collector. (cpp only)

 absolute-path             : Print absolute file path in trace output.

 advanced-telemetry        : Allow the SWF to be measured with Monocle tool.

                             (flash only)

 analyzer-optimize         : Perform advanced optimizations.

 analyzer-times            : <level: 0 | 1 | 2> Record detailed timers for the

                             analyzer

 annotate-source           : Add additional comments to generated source code.

                             (cpp only)

 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#. (cs only)

 cppia                     : Generate cpp instruction assembly.

 cs-ver                    : <version> The C# version to target. (cs only)

 dce                       : <mode: std | full | no> Set the dead code

                             elimination mode. (default: std)

 dce-debug                 : Show DCE log.

 debug                     : Activated when compiling with -debug.

 disable-unicode-strings   : Disable Unicode support in `String` type. (cpp

                             only)

 display                   : Activated during completion.

 display-stdin             : Read the contents of a file specified in

                             `--display` from standard input.

 dll-export                : GenCPP experimental linking. (cpp only)

 dll-import                : Handle Haxe-generated .NET DLL imports. (cs only)

 doc-gen                   : Do not perform any removal/change in order to

                             correctly generate documentation.

 dump                      : <mode: pretty | record | position | legacy> Dump

                             typed AST in dump subdirectory using specified mode

                             or non-prettified default.

 dump-dependencies         : Dump the classes dependencies in a dump

                             subdirectory.

 dump-ignore-var-ids       : Remove variable IDs from non-pretty dumps (helps

                             with diff).

 dump-path                 : <path> Path to generate dumps to (default:

                             "dump").

 dynamic-interface-closures: Use slow path for interface closures to save

                             space. (cpp only)

 erase-generics            : Erase generic classes on C#. (cs only)

 eval-call-stack-depth     : <depth> Set maximum call stack depth for eval.

                             (default: 1000) (eval only)

 eval-debugger             : Support debugger in macro/interp mode. Allows

                             `host:port` value to open a socket. Implies

                             eval-stack. (eval only)

 eval-pretty-print         : Enable indented output for eval printing. (eval

                             only)

 eval-print-depth          : <depth> Set maximum print depth (before replacing

                             with '<...>') for eval. (default: 5) (eval only)

 eval-stack                : Record stack information in macro/interp mode.

                             (eval only)

 eval-times                : Record per-method execution times in macro/interp

                             mode. Implies eval-stack. (eval only)

 fast-cast                 : Enables an experimental casts cleanup on C# and

                             Java. (for java,cs)

 fdb                       : Enable full flash debug infos for FDB interactive

                             debugging. (flash only)

 file-extension            : Output filename extension for cpp source code.

                             (cpp only)

 filter-times              : Record per-filter execution times upon --times.

 flash-strict              : More strict typing for flash target. (flash only)

 flash-use-stage           : Keep the SWF library initial stage. (flash only)

 force-lib-check           : Force the compiler to check `--net-lib` and

                             `--java-lib` added classes (internal). (for

                             java,cs)

 force-native-property     : Tag all properties with `:nativeProperty` metadata

                             for 3.1 compatibility. (cpp only)

 gencommon-debug           : GenCommon internal. (for java,cs)

 haxe                      : The current Haxe version value in SemVer format.

 haxe-boot                 : Give the name 'haxe' to the flash boot class

                             instead of a generated name. (flash only)

 haxe-next                 : Enable experimental features that are meant to be

                             released on next Haxe version.

 haxe-ver                  : The current Haxe version value as decimal number.

                             E.g. 3.407 for 3.4.7.

 haxe3compat               : Gives warnings about transition from Haxe 3.x to

                             Haxe 4.0.

 hl-ver                    : <version> The HashLink version to target.

                             (default: 1.10.0) (hl only)

 hlc                       : Defined by compiler when using hl/c target. (hl

                             only)

 hxcpp-api-level           : Provided to allow compatibility between hxcpp

                             versions. (cpp only)

 hxcpp-smart-strings       : Use wide strings in hxcpp. (Turned on by default

                             unless `-D disable-unicode-strings` is specified.)

                             (cpp only)

 include-prefix            : Prepend path to generated include files. (cpp

                             only)

 interp                    : The code is compiled to be run with `--interp`.

 jar-legacy-loader         : Use the legacy loader to load .jar files on the

                             JVM target. (java only)

 java-ver                  : <version: 5-7> Sets the Java version to be

                             targeted. (java only)

 js-classic                : Don't use a function wrapper and strict mode in JS

                             output. (js only)

 js-enums-as-arrays        : Generate enum representation as array instead of

                             as object. (js only)

 js-es                     : <version: 3 | 5 | 6> Generate JS compliant with

                             given ES standard version. (default: 5) (js only)

 js-global                 : Customizes the global object name. (js only)

 js-source-map             : Generate JavaScript source map even in non-debug

                             mode. Deprecated in favor of `-D source-map`. (js

                             only)

 js-unflatten              : Generate nested objects for packages and types.

                             (js only)

 jvm                       : Generate jvm directly. (java only)

 jvm.compression-level     : Set the compression level of the generated file

                             between 0 (no compression) and 9 (highest

                             compression). Default: 6 (java only)

 jvm.dynamic-level         : Controls the amount of dynamic support code being

                             generated. 0 = none, 1 = field read/write

                             optimization (default), 2 = compile-time method

                             closures (java only)

 keep-inline-positions     : Don't substitute positions of inlined expressions

                             with the position of the place of inlining.

 keep-old-output           : Keep old source files in the output directory.

                             (for java,cs)

 loop-unroll-max-cost      : <cost> Maximum cost (number of expressions *

                             iterations) before loop unrolling is canceled.

                             (default: 250)

 lua-jit                   : Enable the jit compiler for lua (version 5.2

                             only). (lua only)

 lua-vanilla               : Generate code lacking compiled extern lib support

                             (e.g. utf8). (lua only)

 lua-ver                   : <version> The lua version to target. (lua only)

 macro                     : Defined when code is compiled in the macro

                             context.

 macro-times               : Display per-macro timing when used with `--times`.

 message.log-file          : Path to a text file to write message reporting to,

                             in addition to regular output.

 message.log-format        : <format: classic | pretty | indent> Select message

                             reporting mode for message log file. (default:

                             indent)

 message.no-color          : Disable ANSI color codes in message reporting.

 message.reporting         : <mode: classic | pretty | indent> Select message

                             reporting mode for compiler output. (default:

                             classic)

 neko-no-haxelib-paths     : Disable hard-coded Haxelib ndll paths. (neko only)

 neko-source               : Output neko source instead of bytecode. (neko

                             only)

 neko-v1                   : Keep Neko 1.x compatibility. (neko only)

 net-target                : <name> Sets the .NET target. `netcore` (.NET

                             core), `xbox`, `micro` (Micro Framework), `compact`

                             (Compact Framework) are some valid values.

                             (default: `net`) (cs only)

 net-ver                   : <version: 20-50> Sets the .NET version to be

                             targeted. (cs only)

 netcore-ver               : <version: x.x.x> Sets the .NET core version to be

                             targeted (cs only)

 network-sandbox           : Use local network sandbox instead of local file

                             access one. (flash only)

 no-compilation            : Disable final compilation. (for hl,cpp,java,cs)

 no-debug                  : Remove all debug macros from cpp output.

 no-deprecation-warnings   : Do not warn if fields annotated with

                             `@:deprecated` are used.

 no-flash-override         : Change overrides on some basic classes into HX

                             suffixed methods (flash only)

 no-inline                 : Disable inlining.

 no-macro-cache            : Disable macro context caching.

 no-opt                    : Disable optimizations.

 no-root                   : Generate top-level types into the `haxe.root`

                             namespace. (cs only)

 no-swf-compress           : Disable SWF output compression. (flash only)

 no-traces                 : Disable all trace calls.

 no-tre                    : Disable tail recursion elimination.

 nocppiaast                : Use legacy cppia generation.

 objc                      : Sets the hxcpp output to Objective-C++ classes.

                             Must be defined for interop. (cpp only)

 old-error-format          : Use Haxe 3.x zero-based column error messages

                             instead of new one-based format.

 php-front                 : <filename> Select the name for the php front file.

                             (default: `index.php`) (php only)

 php-lib                   : <folder name> Select the name for the php lib

                             folder. (php only)

 php-prefix                : <dot-separated namespace> Root namespace for

                             generated php classes. E.g. if compiled with`-D

                             php-prefix=some.sub`, then all classes will be

                             generated in `\some\sub` namespace. (php only)

 python-version            : <version> The python version to target. (default:

                             3.3) (python only)

 real-position             : Disables Haxe source mapping when targetting C#,

                             removes position comments in Java and Php output.

                             (for php,java,cs)

 replace-files             : GenCommon internal. (for java,cs)

 retain-untyped-meta       : Prevents arbitrary expression metadata from being

                             discarded upon typing.

 scriptable                : GenCPP internal. (cpp only)

 shallow-expose            : Expose types to surrounding scope of Haxe

                             generated closure without writing to window object.

                             (js only)

 source-header             : Print value as comment on top of generated files,

                             use '' value to disable.

 source-map                : Generate source map for compiled files. (for

                             js,php)

 source-map-content        : Include the Haxe sources as part of the JS source

                             map. (js only)

 static                    : Defined if the current target is static.

 std-encoding-utf8         : Force utf8 encoding for stdin, stdout and stderr

                             (for python,cs,java)

 swc                       : Output a SWC instead of a SWF. (flash only)

 swf-compress-level        : <level: 1-9> Set the amount of compression for the

                             SWF output. (flash only)

 swf-debug-password        : <password> Set a password for debugging. (flash

                             only)

 swf-direct-blit           : Use hardware acceleration to blit graphics. (flash

                             only)

 swf-gpu                   : Use GPU compositing features when drawing

                             graphics. (flash only)

 swf-header                : define SWF header (width:height:fps:color) (flash

                             only)

 swf-metadata              : <file> Include contents of the given file as

                             metadata in the SWF. (flash only)

 swf-preloader-frame       : Insert empty first frame in SWF. (flash only)

 swf-protected             : Compile Haxe `private` as `protected` in the SWF

                             instead of `public`. (flash only)

 swf-script-timeout        : <time in seconds> Maximum ActionScript processing

                             time before script stuck dialog box displays.

                             (flash only)

 swf-use-doabc             : Use `DoAbc` SWF-tag instead of `DoAbcDefine`.

                             (flash only)

 sys                       : Defined for all system platforms.

 unsafe                    : Allow unsafe code when targeting C#. (cs only)

 use-nekoc                 : Use `nekoc` compiler instead of the internal one.

                             (neko only)

 utf16                     : Defined for all platforms that use UTF-16 string

                             encoding with UCS-2 API.

 vcproj                    : GenCPP internal. (cpp only)

 warn-var-shadowing        : Warn about shadowing variable declarations.



« 上一篇

相关文章:

haxe-openfl编译成exe  (2026-4-13 16:34:6)

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。