12.6.4 Defines

There are a number of standard defines you can use to control the hxcpp build. Some of these are used by the Haxe compiler, and affect the generated code. Others apply to the build tool and affect how the code is compiled.

Code generation

Defines affecting how the code is generated. These need to be in the command line when calling haxe.

DefineMeaning
HXCPP_DEBUGGERAdd extra macros required by debugger. Usually added automatically by the debugger haxelib.
HXCPP_GC_GENERATIONALEnable experimental generational garbage collector.
annotate_sourceAdd additional annotations to the generated source code - useful for developing hxcpp.
dll_exportExport hxcpp runtime symbols.
file_extensionSet the extension (without the dot) of generated files. E.g. -D file_extension=mm for Objective-C++ code.
force_native_propertyMake dynamic access to fields call property getters/setters where appropriate.
include_prefixPlace all generated include files in a sub-directory, e.g. -D include_prefix=hxinc. Useful for avoiding name clashes.
no-compilationGenerate code, but do not compile it.
no-debugDo not generate debug macros in code
nocppiaastUse legacy cppia generation instead of new, more recent changes.
objcGenerate Objective-C++ classes.
scriptableEnable extra runtime information required for scripting.
Compilation

Defines affecting how the code is compiled. These can be on the command line when calling haxe, or added via the hxcpp build environment.

DefineMeaning
HXCPP_GC_MOVINGAllow garbage collector to move memory to reduce fragmentation.
HXCPP_GC_SUMMARYPrint small profiling summary when the program exits.
HXCPP_GC_DYNAMIC_SIZEMonitor GC times and expand memory working space if required.
HXCPP_GC_BIG_BLOCKSAllow working memory greater than 1 gigabyte.
HXCPP_GC_DEBUG_LEVELSpecify a level (1-4) indicating additional debugging in GC.
HXCPP_DEBUG_LINKAdd symbols to final binary, even in release mode.
HXCPP_STACK_TRACEHave valid function-level stack traces, even in release mode.
HXCPP_STACK_LINEInclude line information in stack traces, even in release mode.
HXCPP_CHECK_POINTERAdd null-pointer checks, even in release mode.
HXCPP_PROFILERAdd profiler support.
HXCPP_TELEMETRYAdd telemetry support.
HXCPP_CPP11Use C++11 features and link libraries.
exe_linkGenerate executable file (rather than dynamic library on Android).
static_linkGenerate static library.
dll_linkGenerate dynamic library.
Other
DefineMeaning
HXCPP_VERBOSEPrint extra output from build tool.
HXCPP_TIMESShow some basic profiling information.
HXCPP_NEKO_BUILDTOOLForce use of hxcpp.n, rather than the compiled BuildTool.exe.
HXCPP_NO_COLORDo not add color-codes to build tool output.
HXCPP_KEEP_TEMPDo not delete the files created for file embedName option.
Target architecture
DefineMeaning
HXCPP_M32Force 32-bit compile for current desktop.
HXCPP_M64Force 64-bit compile for current desktop.
HXCPP_ARMV6Compile ARM-based devices for armv6.
HXCPP_ARM64Compile ARM-based devices for 64 bits.
HXCPP_ARMV7Compile ARM-based devices for armv7.
HXCPP_ARMV7SCompile ARM-based devices for armv7s.
HXCPP_LINUX_ARMV7Compile for a Linux ARMv7 device.
HXCPP_LINUX_ARM64Compile for a Linux ARM64 device.
winrtCompile for windowsRt/windows UWP.
androidCompile for Android.
PLATFORMSpecify the Android platform for NDK compilation.
ANDROID_NDK_ROOTSpecify the location of the Android NDK toolchain.
ANDROID_NDK_DIRSpecify the search location for finding the android NDK toolchain.
HXCPP_X86Compile android for x86 architecture.
iphoneosCompile for iPhone iOS.
iphonesimCompile for iPhone simulator.
appletvosCompile for Apple tvOS.
appletvsimCompile for Apple tvOS simulator.
watchosCompile for Apple watchOS.
watchsimulatorCompile for Apple watchOS simulator.
webosCompile for webOS.
tizenCompile for Tizen.
blackberryCompile for Blackberry-
emscriptenCompile for Emscripten.
cygwinCompile for Windows using Cygwin.
linux(Cross) Compile for Linux.
rpi(Cross) Compile for Raspberry Pi.
mingwCompile for Windows using MinGW.
HXCPP_MINGWCompile for Windows using MinGW.
NO_AUTO_MSVCDo not detect MSVC location, use the one already in the executable path.