# Appendix

# CMake Flags

The following CMake flags can be seen when building an application using the CMake-GUI. Be aware that some defines require other defines to be set first in order to be displayed in the CMake-GUI.

# Candera flags

- **CANDERA\_3D\_CANVAS\_ENABLED** defines whether Candera3D Canvas is enabled or not.
- **CANDERA\_ASSETLOADER\_MEMORYPOOL\_ENABLED** defines whether asset loader objects are allocated from a dedicated memory pool or not.
- **CANDERA\_ASSETLOADER\_WORKER\_THREAD\_ENABLED** uses an own worker thread for asynchronous asset loader calls.
- **CANDERA\_ASSET\_CACHE\_SIZE** defines the buffer size for asset caching. A memory chunk of this size will be allocated for caching asset chunks for fast access.
- **CANDERA\_ASSET\_DECOMPRESSION\_CHUNK\_SIZE** defines the chunk buffer size for asset decompression. This value is only relevant for File Asset Repositories.
- **CANDERA\_BIDIRECTIONAL\_TEXT\_ENABLED** defines whether bidirectional text parsing is enabled or not.
- **CANDERA\_CUSTOM\_LOCALIZER\_ENABLED** defines whether or not a custom Localizer must be used instead of the DefaultLocalizer.
- **CANDERA\_EXTERNAL\_SHADER\_BUILDER\_HEADER\_INCLUDE** includes path to external CPP header file, referenced by CANDERA\_EXTERNAL\_SHADER\_BUILDER\_HEADER\_PATH.
- **CANDERA\_EXTERNAL\_SHADER\_BUILDER\_HEADER\_PATH** defines path to external CPP header file with BUILD\_SHADER macro definition, relative to Common/Internal/RenderDevice2DOver3D/.
- **CANDERA\_EXTERNAL\_SHADER\_BUILDER\_SOURCE\_PATH** defines path to external CPP source file with binary shaders data, relative to Common/Internal/RenderDevice2DOver3D/.
- **CANDERA\_FONTENGINE** defines which font engine to use.
- **CANDERA\_GLOBALIZATION\_ENABLED** defines whether globalization support is enabled or not.
- **CANDERA\_LAYOUT\_CLIPPING\_ENABLED** defines whether Candera2D layout clipping (setting a clipping rectangle for every render node) is enabled or not.
- **CANDERA\_LAYOUT\_ENABLED** defines whether Candera dynamic layout is enabled or not.
- **CANDERA\_LEGACY\_BEHAVIORS\_ENABLED** builds with legacy behaviors.
- **CANDERA\_MULTILINE\_TEXT\_ENABLED** defines whether multiline texts are enabled or not.
- **CANDERA\_SCRIPTING\_ENABLED** defines whether CanderaScripting sources shall be included or not.
- **CANDERA\_TEXTENGINE\_DLIG\_FEATURE\_ENABLED** defines if Discretionary Ligatures (dlig) are enabled or not (support only in Harfbuzz for now).
- **CANDERA\_TEXTENGINE\_MEMORYPOOL\_ENABLED** defines whether text engine objects are allocated from a dedicated memory pool or not.
- **CANDERA\_TEXTENGINE\_NATIVE\_LINEHEIGHT\_ENABLED** defines whether or not the native line height metrics of the font engine is used. If disabled then 120% of EM size is applied as line height which is compatible with Adobe.
- **CANDERA\_TEXTENGINE\_WORKER\_THREAD\_ENABLED** uses an own worker thread for asynchronous textrender calls. It uses the update routine (single threaded) when this flag is disabled.
- **CANDERA\_TEXTSHAPER** selects the text shaper.
- **CANDERA\_TRANSITIONS\_ENABLED** defines whether CanderaTransitions sources shall be included or not.
- **CANDERA\_VIDEO\_MEMORY\_STATISTIC\_ENABLED** activates support for video memory allocation statistics. ATTENTION: Activated memory statistics may decrease performance!
- **CANDERA\_ASSET\_ADDRESS** is the address for eMMC / QSPI flash access
- **CANDERA\_ASSET\_ADDRESS\_USE\_DEFAULT** defines the default address for flash access   
    
    - - 0x00000000 for eMMC
        - 0x2000000 for QSPI
- **CANDERA\_ASSET\_LOCATION** is the asset location chosen by the user at CMake configure time
- **CANDERA\_BUILD\_SCHOST** defines whether SCHost library and DLL are built or not
- **CGIDEVICE\_BSP\_LIBRARY\_PATH** defines the path to directory including libfbdev.a (for RCarD3, RCarH3 and RCarM3 devices)
- **CGIDEVICE\_EGL\_INCLUDE\_PATH** defines path to EGL folder
- **CGIDEVICE\_GFX\_LIBRARY\_PATH** defines the path to graphics libraries (for RCarD3, RCarH3 and RCarM3 devices)
- **CGIDEVICE\_OPENGL\_EGL\_CONFIG\_PATH** defines the path to OpenGL and EGL configuration files (for RCarD3 and RCarH3 devices)
- **CGIDEVICE\_OPENGL\_ES\_30\_INCLUDE\_PATH** defines the path to GLES3 folder
- **CANDERA\_EXTERNAL\_SHADER\_BUILDER\_USAGE\_DEFAULT** defines whether the default paths for external shader builder for 2DOver3D shaders are used or not."

# Courier flags

- **COURIER\_DATA\_LOCK\_ENABLED** enables the data lock.
- **COURIER\_ENHANCED\_ENABLED** enables data binding and visualization, which enables Candera graphics engine support.
- **COURIER\_ENHANCE-SERIALIZATION\_ENABLED** activates message serialization.
- **COURIER\_MESSAGING\_MONITOR\_ENABLED** enables messaging monitor.
- **COURIER\_PLATFORM** defines the platform Courier is built for.
- **COURIER\_PLATFORM\_CONFIG** defines the platform configuration Courier is built for.
- **COURIER\_PREBUILT\_LIB\_DIR** sets the location of pre-built Courier library root folder. Compiler and build configuration are added.
- **COURIER\_RENDERING\_MONITOR\_ENABLED** enables rendering monitor.
- **COURIER\_USE\_PREBUILT\_LIBS** uses pre-built Courier libraries in solution instead of Courier sources.
- **COURIER\_CMAKE\_LOGGING\_LEVEL** defines the verbosity level of Courier CMake system
- **COURIER\_MESSAGE\_SERIALIZATION\_ENABLED** activates message serialization
- **COURIER\_CUSTOM\_INJECT\_WIDGET\_BASE\_ENABLED** enables the use of customized includes.
- **COURIER\_PLATFORMDEFS\_DIR** sets customer specific search path for Courier platform definitions.
- **COURIER\_SCRIPTING\_ENABLED** enables Courier scripting system support.

# FeatStd flags

- **FEATSTD\_32BIT\_PLATFORM** a 32 bit compiler is used.
- **FEATSTD\_64BIT\_PLATFORM** a 64 bit compiler is used.
- **FEATSTD\_CUSTOM\_CONFIG** adds custom config header file.
- **FEATSTD\_GLERRORS\_AND\_EGLERRORS\_ENABLED** enables glGetError and eglGetError calls.
- **FEATSTD\_IPC\_ENABLED** enables IPC functionality, like IPC channels, etc.
- **FEATSTD\_LOGGER\_MAX\_BUFFER\_SIZE** defines the maximum length of a single log message.
- **FEATSTD\_LOG\_ENABLED** enables logging functionality. If disabled all logging defines are expanded empty and all logging classes (e.g. Appender) will not be available. This means the application which uses e.g. Appender has to scope this usage with FEATSTD\_LOG\_ENABLED.
- **FEATSTD\_MEMORYPOOL\_ENABLED** enables optional component MemoryPool. MemoryPool is an optional component of FeatStd.
- **FEATSTD\_MEMORYPOOL\_FEATURES\_DEBUG** defines MemoryPool features for debug build mode.
- **FEATSTD\_MEMORYPOOL\_FEATURES\_MINSIZEREL** defines MemoryPool features for minimal size build mode.
- **FEATSTD\_MEMORYPOOL\_FEATURES\_RELEASE** defines MemoryPool features for debug release mode.
- **FEATSTD\_MEMORYPOOL\_FEATURES\_RELWITHDEBINFO** defines MemoryPool features for release with debugging info build mode.
- **FEATSTD\_MONITOR\_ENABLED** enables monitor module.
- **FEATSTD\_STRINGBUFFER\_APPENDER\_CANDERATYPESIZE** defines the maximum size of one Candera type used with string buffer appender.
- **FEATSTD\_STRINGBUFFER\_APPENDER\_ENABLED** enables the additional StringBuffer AppendObject method and the StringBufferAppender template. StringBufferAppender implementations for specific types like enum, struct or class types have to be provided by the more specific library/application code (manually or generated).
- **FEATSTD\_THREADSAFETY\_ENABLED** activates thread safety for various FeatStd modules like logging, etc.
- **FEATSTD\_UNITTEST\_FRAMEWORK\_ENABLED** activates unit test framework support.
- **FEATSTD\_FILE\_** usually should be ‘\_\_FILE\_\_’ but for some special gcc build it could be set to ‘\_\_BASE\_FILE\_\_’.
- **CGIAPP\_ENABLE\_ADDITIONAL\_BEHAVIORS** defines whether additional behaviors are enabled or not
- **FEATSTD\_CMAKE\_LOGGING\_LEVEL** set verbosity level of FeatStd CMake system

# Monitor flags

- **MONITOR\_BLOCK\_UNTIL\_CONNECT** enables waiting until host connects to target.
- **MONITOR\_CANDERA\_CUSTOM\_EXPERIMENTS** enables custom global experiments.
- **MONITOR\_CANDERA\_PERFORMANCE\_RECORDER\_ENABLED** defines whether or not to expand performance recocrder macros.
- **MONITOR\_CANDERA\_PERFORMANCE\_RECORDER\_GENERATION\_DIR** sets the location of the Candera performance recorder generation.
- **MONITOR\_CANDERA\_PERFORMANCE\_RECORDER\_TEMPLATE\_DIR** sets the location of the Candera performance recorder template.
- **MONITOR\_COM\_TYPE** sets the type of monitoring connection.
- **MONITOR\_FRAME\_DEBUGGER\_ENABLED** enables basic frame debugger (frame timeline capture, single step mode, no OpenGL specific features).
- **MONITOR\_FRAME\_DEBUGGER\_OPENGL\_CAPTURE\_ENABLED** enables OpenGL specific Frame Debugger features.
- **MONITOR\_MEMORYPOOL\_BINARY\_LOGGING\_ENABLED** activates the Memory Pool activity logging.
- **MONITOR\_MEMORYPOOL\_BINARY\_LOGGING\_FILENAME** location where the log-file will be generated. The extension has to be \*.membin.
- **MONITOR\_RECORDING\_2D\_CALLS\_ENABLED** enables all 2D driver calls.
- **MONITOR\_RECORDING\_OPENGL\_ENABLED** enables all OpenGL Recorder (e.g. Timing Recorder of OpenGL).
- **MONITOR\_SINGLE\_STEP\_INTERVAL** sets the time in milliseconds that is used when incrementing the animation time in single-step mode.
- **MONITOR\_TCPIP\_ADDRESS** sets the adress of target device which is a server. Therefore this is the listening ip 0.0.0.0 and enables listening to any address.
- **MONITOR\_TCPIP\_PORT** sets the TcpIp port number.

# CGIApp flags

- **CGIAPP\_ADDITIONAL\_BEHAVIOR\_PATH** sets the file containing additional behaviors paths.
- **CGIAPP\_ADDITIONAL\_WIDGET\_PATH** sets the path to a txt file.
- **CGIAPP\_ENABLE\_ADDITIONAL\_WIDGETS** points to a custom provided additional widgets file.
- **CGIAPP\_WIDGETSET\_VERSION** sets the version of the widget.
- **CGIAPP\_ENABLE\_TUTORIAL** defines whether CGI-Application tutorial is enabled or not (CGI Studio Documentation-&gt;Application Development-&gt;Candera-&gt;Tutorials)
- **CGIAPP\_ENABLE\_ADDITIONAL\_BEHAVIORS** defines whether Behaviors feature is enabled or not
- **CGIAPP\_BUILD\_TYPE** defines the binary type of the build application. It can be set to NativeDll or NativeExe.
- **CGIAPP\_PLAYER\_DEBUG\_PATH** defines the path to the CGI Player executable for debug builds. On simulation, for example, the executable will be stored in the device directory present next to the CGIPanel.exe.
- **CGIAPP\_PLAYER\_RELEASE\_PATH** is the path to the CGI Player executable for release builds. On simulation, for example, the executable will be stored in the device directory present next to the CGIPanel.exe.
- **CGIAPP\_SAMPLE\_CLOCK\_ENABLED** enables the clock sample feature. If enabled the application will be built with the Clock sample component allowing to use the AnalogWatch control when its Time property is bound to the /Time/CurrentTime data item.
- **CGIAPP\_SAMPLE\_DYNAMICLIST\_ENABLED** enables the dynamic list sample feature.
- **CGIAPP\_SCENE\_COMPOSER\_PATH** defines the path to Scene Composer.
- **CGISTUDIO\_FORCE\_RESET\_USER\_SETTINGS** forces the generation of MSVC user settings even if they exist.
- **SCHOST\_DLL\_NAME\_CUSTOM** defines a custorm name for SCHost DLL
- **SCHOST\_DLL\_NAME\_PLATFORM\_SPECIFIC** defines whether or not to use platform specific name for SCHost.dll
- **SCHOST\_DLL\_OUTPUT\_PATH** defines the output path for SCHost.dll. Typically is the path to the Scene Composer.

# Control Behaviors Flags

- **CONTROLS\_BREADCRUMB\_BEHAVIORS\_ENABLED** - Build with BreadCrumb Behaviors  
    (BreadcrumbActionBehavior, BreadcrumbBehavior)
- **CONTROLS\_DEMO\_BEHAVIORS\_ENABLED** - Build with Behaviors intended for demonstration purpose  
    (<span style="color: rgb(230, 126, 35);">[ValueGeneratorBehavior](https://doc316en.candera.eu/link/647#bkmrk-value-gererator)</span>)
- **CONTROLS\_EDITTEXT\_BEHAVIORS\_ENABLED** - Build with Edit Text Behaviors  
    (CaretBehavior, EditTextBehavior, EnterExitConditionBehavior)
- **CONTROLS\_EXTERNALRESOURCE\_BEHAVIORS\_ENABLED** - Build with External Resource Behaviors  
    (ExternalBitmapProviderBehavior, ExternalResourceChangeConditionBehavior, SetExternalBitmapActionBehavior)
- **CONTROLS\_GLOBALIZATION\_BEHAVIORS\_ENABLED** - Build with Globalization Behaviors  
    (CultureChangeConditionBehavior, SetCultureActionBehavior)
- **CONTROLS\_GRAPH\_BEHAVIORS\_ENABLED** - Build with Graph Behaviors  
    (BarGraphBehavior, LineGraphBehavior)
- **CONTROLS\_HOVER\_EVENT\_ENABLED** - Activate hover events from Control Touch Session
- **CONTROLS\_KEYBOARD\_BEHAVIORS\_ENABLED** - Build with Keyboard Behaviors  
    (KeyboardActionBehavior, KeyboardBehavior)
- **CONTROLS\_MAP\_BEHAVIORS\_ENABLED** - Build with Map Behaviors  
    (GeocodingBehavior, MapActionBehavior, MapBridgeBehavior, MapLocationActionBehavior, MapNavigationActionBehavior, NavigationInstructionViewBehavior)
- **CONTROLS\_MENU\_BEHAVIORS\_ENABLED** - Build with Menu Behaviors  
    (MenuItemBehavior, MenuScreenActionBehavior, MenuScreenBehavior, PageIndicatorActionBehavior, PageIndicatorBehavior)
- **CONTROLS\_MESH\_BEHAVIORS\_ENABLED** - Build with Mesh2D Behaviors  
    (TransformMesh2DBehavior)
- **CONTROLS\_MIXEDREALITY\_BEHAVIORS\_ENABLED** - Build with Mixed Reality Behaviors  
    (NavigationPathBehavior, PoiBehavior, PoiConfigBehavior, PoiManagerBehavior, PoseTrackingBehavior)
- **CONTROLS\_PARTICLE\_EMITTER\_BEHAVIORS\_ENABLED** - Build with Particle Emitter Behaviors  
    (ParticleEmitterBehavior)
- **CONTROLS\_PLUGIN\_CONFIGURATION\_ENABLED** - Use the output from the "Used Behaviors Plugin". See <span style="color: rgb(230, 126, 35);">[Used Behaviors Plugin](https://doc316en.candera.eu/books/build-system-setup/page/used-behaviors-plugin "Used Behaviors Plugin")</span>.
- **CONTROLS\_ROLL\_BEHAVIORS\_ENABLED** - Build with Roll Behaviors  
    (RollBehavior)
- **CONTROLS\_SCRIPTING\_BEHAVIORS\_ENABLED** - Build with Scripting Behaviors  
    (EnableScriptingSystemBehavior)
- **CONTROLS\_SCROLL\_LIST\_BEHAVIORS\_ENABLED** - Build with Scroll &amp; List Behaviors  
    (ScrollViewBehavior, ListBehavior, SnapListItemConfigurationBehavior, SnapListItemExtensionBehavior, SubListBehavior, ScrollableEventActionBehavior, ScrollbarBehavior)
- **CONTROLS\_SELECTION\_GROUP\_BEHAVIORS\_ENABLED** - Build with Selection Group Behaviors  
    (ChangeSelectionActionBehavior, SelectionConditionBehavior, SelectionGroupBehavior)
- **CONTROLS\_SLIDER\_BEHAVIORS\_ENABLED** - Build with Slider Behaviors (Slider, CircularSlider, Dial)  
    (SliderBehavior, CircularSliderBehavior, DialBehavior)
- **CONTROLS\_STREAMING\_BEHAVIORS\_ENABLED** - Build with Streaming Behaviors  
    (VideoStateConditionBehavior, VideoStreamActionBehavior, VideoStreamBehavior)
- **CONTROLS\_USED\_BEHAVIORS\_CONFIG\_PATH** - Path to the output file of the "Used Behaviors Plugin". Flag is only available if flag *CONTROLS\_PLUGIN\_CONFIGURATION\_ENABLED* is active. See <span style="color: rgb(230, 126, 35);">[Used Behaviors Plugin](https://doc316en.candera.eu/books/build-system-setup/page/used-behaviors-plugin "Used Behaviors Plugin")</span>.

# Third Party Software Flags

- **CGIDEVICE\_TARGET\_EGL\_GLES2\_IMPLEMENTATION** select target EGL and GLES2 implementation: libEGL (EGL and GLES2 directly) or GLX (EGL and GLES2 through OpenGLAdapter over GLX)

# FreeType flags

- **FREETYPE2\_CONFIGURE\_CACHE** enables or disables freetype cache configuration.
- **FREETYPE2\_FACE\_COUNT\_MAX** sets the maximum number of faces supported by cache and must be a constant integral C expression.
- **FREETYPE2\_FACE\_SIZE\_COUNT\_MAX** sets the maximum number of sizes supported by cache and must be a constant integral C expression.
- **FREETYPE2\_GLYPH\_CACHE\_SIZE** defines the size of the buffer to cache glyph bitmaps and must be a constant integral C expression.
- **FREETYPE2\_MODLOAD\_DRIVER\_BDF** defines whether the BDF (Bitmap Distribution Format) font driver module is loaded or not.
- **FREETYPE2\_MODLOAD\_DRIVER\_CFF** defines whether the CFF font driver module is loaded or not.
- **FREETYPE2\_MODLOAD\_DRIVER\_PCF** defines whether the PCF font driver module is loaded or not.
- **FREETYPE2\_MODLOAD\_DRIVER\_PFR** defines whether the PFR font driver module is loaded or not.
- **FREETYPE2\_MODLOAD\_DRIVER\_T1** defines whether the T1 font driver module is loaded or not.
- **FREETYPE2\_MODLOAD\_DRIVER\_T1CID** defines whether the T1CID font driver module is loaded or not.
- **FREETYPE2\_MODLOAD\_DRIVER\_T42** defines whether the T42 font driver module is loaded or not.
- **FREETYPE2\_MODLOAD\_DRIVER\_TT** defines whether the TT font driver module is loaded or not.
- **FREETYPE2\_MODLOAD\_DRIVER\_WINFNT** defines whether the WINFNT font driver module is loaded or not.
- **FREETYPE2\_MODLOAD\_MODULE\_AUTOFIT** defines whether the autofitter (auto-hinter) module is loaded or not.
- **FREETYPE2\_MODLOAD\_MODULE\_PSAUX** defines whether the helper module psaux is loaded or not.
- **FREETYPE2\_MODLOAD\_MODULE\_PSHINTER** defines whether the module pshinter is loaded or not.
- **FREETYPE2\_MODLOAD\_MODULE\_PSNAMES** defines whether the helper module psnames is loaded or not.
- **FREETYPE2\_MODLOAD\_MODULE\_SFNT** defines whether the helper module sfnt is loaded or not.
- **FREETYPE2\_MODLOAD\_RENDERER\_FT\_RASTER1** defines whether the renderer module raster1 is loaded or not.
- **FREETYPE2\_MODLOAD\_RENDERER\_FT\_SMOOTH** defines whether the renderer module smooth is loaded or not.
- **FREETYPE2\_MODLOAD\_RENDERER\_FT\_SMOOTH\_LCD** defines whether the renderer module smooth\_lcd is loaded or not.
- **FREETYPE2\_MODLOAD\_RENDERER\_FT\_SMOOTH\_LCDV** defines whether the renderer module smooth\_lcdv is loaded or not.
- **FREETYPE2\_OPT\_AF\_CONFIG\_OPTION\_CJK** compile autofit module with CJK (Chinese, Japanese, Korean) script support.
- **FREETYPE2\_OPT\_AF\_CONFIG\_OPTION\_INDIC** compile autofit module with fallback Indic script support.
- **FREETYPE2\_OPT\_AF\_CONFIG\_OPTION\_USE\_WARPER** compile autofit module with warp hinting.
- **FREETYPE2\_OPT\_CFF\_CONFIG\_OPTION\_DARKENING\_PARAMETER\_X1** set the default X value for the first control point that define the stem darkening behavior of the CFF engine.
- **FREETYPE2\_OPT\_CFF\_CONFIG\_OPTION\_DARKENING\_PARAMETER\_X2** set the default X value for the second control point that define the stem darkening behavior of the CFF engine.
- **FREETYPE2\_OPT\_CFF\_CONFIG\_OPTION\_DARKENING\_PARAMETER\_X3** set the default X value for the third control point that define the stem darkening behavior of the CFF engine.
- **FREETYPE2\_OPT\_CFF\_CONFIG\_OPTION\_DARKENING\_PARAMETER\_X4** set the default X value for the forth control point that define the stem darkening behavior of the CFF engine.
- **FREETYPE2\_OPT\_CFF\_CONFIG\_OPTION\_DARKENING\_PARAMETER\_Y1** set the default Y value for the first control point that define the stem darkening behavior of the CFF engine.
- **FREETYPE2\_OPT\_CFF\_CONFIG\_OPTION\_DARKENING\_PARAMETER\_Y2** set the default Y value for the second control point that define the stem darkening behavior of the CFF engine.
- **FREETYPE2\_OPT\_CFF\_CONFIG\_OPTION\_DARKENING\_PARAMETER\_Y3** set the default Y value for the third control point that define the stem darkening behavior of the CFF engine.
- **FREETYPE2\_OPT\_CFF\_CONFIG\_OPTION\_DARKENING\_PARAMETER\_Y4** set the default Y value for the forth control point that define the stem darkening behavior of the CFF engine.
- **FREETYPE2\_OPT\_FT\_CONFIG\_OPTION\_ADOBE\_GLYPH\_LIST** enables the compilation of 'PSNames' with Adobe Glyph List.
- **FREETYPE2\_OPT\_FT\_CONFIG\_OPTION\_DISABLE\_STREAM\_SUPPORT** define to disable the use of file stream functions and types, FILE,fopen() etc. Enables the use of smaller system libraries on embedded systems that have multiple system libraries, some with or without file stream support, in the cases where file stream support is not necessary such as memory loading of font files.
- **FREETYPE2\_OPT\_FT\_CONFIG\_OPTION\_FORCE\_INT64** enables the usage of 64-bit integers data types when \_\_STDC\_\_ macro is defined.
- **FREETYPE2\_OPT\_FT\_CONFIG\_OPTION\_INCREMENTAL** allows the use of FT\_Incremental\_Interface to load typefaces that contain no glyph data, but supply it via a callback function.
- **FREETYPE2\_OPT\_FT\_CONFIG\_OPTION\_INLINE\_MULFIX** enables the usage of an inlined assembler version of the `FT\_MulFix' function.
- **FREETYPE2\_OPT\_FT\_CONFIG\_OPTION\_MAC\_FONTS** enables support for outline fonts in Mac format (mac dfont, mac resource, macbinary containing a mac resource) on non-Mac platforms.
- **FREETYPE2\_OPT\_FT\_CONFIG\_OPTION\_NO\_ASSEMBLER** prevents the usage of an assembler version of performance-critical functions (e.g. FT\_MulFix).
- **FREETYPE2\_OPT\_FT\_CONFIG\_OPTION\_OLD\_INTERNALS** this macro is obsolete. Support has been removed in FreeType version 2.5.
- **FREETYPE2\_OPT\_FT\_CONFIG\_OPTION\_PIC i**f set FreeType2 will avoid creating constants that require address fixups.
- **FREETYPE2\_OPT\_FT\_CONFIG\_OPTION\_POSTSCRIPT\_NAMES** defines whether or not to load and enumerate the glyph Postscript names in a TrueType or OpenType file.
- **FREETYPE2\_OPT\_FT\_CONFIG\_OPTION\_SUBPIXEL\_RENDERING** activate LCD rendering technology similar to ClearType in the build of the library.
- **FREETYPE2\_OPT\_FT\_CONFIG\_OPTION\_SYSTEM\_ZLIB** allows FreeType's 'ftgzip' component to link to the system's installation of the ZLib library.
- **FREETYPE2\_OPT\_FT\_CONFIG\_OPTION\_USE\_BZIP2** enables FreeType to handle font files that have been compressed with the 'bzip2' program.
- **FREETYPE2\_OPT\_FT\_CONFIG\_OPTION\_USE\_HARFBUZZ** enables FreeType to use the HarfBuzz library to improve auto-hinting of OpenType fonts.
- **FREETYPE2\_OPT\_FT\_CONFIG\_OPTION\_USE\_LZW** enables FreeType to handle font files that have been compressed with the ‘compress’ program.
- **FREETYPE2\_OPT\_FT\_CONFIG\_OPTION\_USE\_MODULE\_ERRORS** if enabled change the error codes so the higher byte gives the module in which the error has occurred, while the lower byte is the real error code.
- **FREETYPE2\_OPT\_FT\_CONFIG\_OPTION\_USE\_PNG** enables FreeType to handle the loading of color bitmap glyphs in the PNG format.
- **FREETYPE2\_OPT\_FT\_CONFIG\_OPTION\_USE\_ZLIB** enables FreeType to handle font files that have been compressed with the 'gzip' program.
- **FREETYPE2\_OPT\_FT\_DEBUG\_AUTOFIT** if defined, FreeType provides some means to control the autofitter behaviour for debugging purposes with global boolean variables.
- **FREETYPE2\_OPT\_FT\_DEBUG\_LEVEL\_ERROR** enables the build of FreeType library in debug mode. FREETYPE2\_OPT\_FT\_DEBUG\_LEVEL\_TRACE enables the build of FreeType library in trace mode.
- **FREETYPE2\_OPT\_FT\_DEBUG\_MEMORY** enables the compilation of FreeType library with an integrated memory debugger that is capable of detecting simple errors like memory leaks or double deletes.
- **FREETYPE2\_OPT\_FT\_MAX\_MODULES** defines the maximum number of modules that can be registered in a single FreeType library object (32 is the default).
- **FREETYPE2\_OPT\_FT\_RENDER\_POOL\_SIZE** defines the size in bytes of the render pool used by the scan-line converter to do all of its work.
- **FREETYPE2\_OPT\_T1\_CONFIG\_OPTION\_NO\_AFM** prevents the compilation of ‘t1afm’, which is in charge of reading Type 1 AFM files into an existing face.
- **FREETYPE2\_OPT\_T1\_CONFIG\_OPTION\_NO\_MM\_SUPPORT** prevents the compilation of the Multiple Masters font support in the Type 1 driver.
- **FREETYPE2\_OPT\_T1\_MAX\_CHARSTRINGS\_OPERANDS** defines the charstring stack's capacity (minimum 16 is required).
- **FREETYPE2\_OPT\_T1\_MAX\_DICT\_DEPTH** defines the maximum depth of nest dictionaries and arrays in the Type 1 stream (minimum 4 is required).
- **FREETYPE2\_OPT\_T1\_MAX\_SUBRS\_CALLS** defines the maximum number of nested sub-routine calls during glyph loading.
- **FREETYPE2\_OPT\_TT\_CONFIG\_CMAP\_FORMAT\_0** enables support for TrueType CMap table format 0.
- **FREETYPE2\_OPT\_TT\_CONFIG\_CMAP\_FORMAT\_10** enables support for TrueType CMap table format 10.
- **FREETYPE2\_OPT\_TT\_CONFIG\_CMAP\_FORMAT\_12** enables support for TrueType CMap table format 12.
- **FREETYPE2\_OPT\_TT\_CONFIG\_CMAP\_FORMAT\_13** enables support for TrueType CMap table format 13.
- **FREETYPE2\_OPT\_TT\_CONFIG\_CMAP\_FORMAT\_14** enables support for TrueType CMap table format 14.
- **FREETYPE2\_OPT\_TT\_CONFIG\_CMAP\_FORMAT\_2** enables support for TrueType CMap table format 2.
- **FREETYPE2\_OPT\_TT\_CONFIG\_CMAP\_FORMAT\_4** enables support for TrueType CMap table format 4.
- **FREETYPE2\_OPT\_TT\_CONFIG\_CMAP\_FORMAT\_6** enables support for TrueType CMap table format 6.
- **FREETYPE2\_OPT\_TT\_CONFIG\_CMAP\_FORMAT\_8** enables support for TrueType CMap table format 8.
- **FREETYPE2\_OPT\_TT\_CONFIG\_OPTION\_BDF** defines whether to include or not support for an embedded ‘BDF’ table within SFNT-based bitmap formats.
- **FREETYPE2\_OPT\_TT\_CONFIG\_OPTION\_BYTECODE\_INTERPRETER** defines whether the TrueType driver should be compiled or not with a bytecode interpreter.
- **FREETYPE2\_OPT\_TT\_CONFIG\_OPTION\_COMPONENT\_OFFSET\_SCALED** defines whether to use or not the Apple's definition of how to handle component offsets in composite glyphs while compiling the TrueType glyph loader.
- **FREETYPE2\_OPT\_TT\_CONFIG\_OPTION\_EMBEDDED\_BITMAPS** defines whether to support or not embedded bitmaps in all formats using the SFNT module (namely TrueType &amp; OpenType).
- **FREETYPE2\_OPT\_TT\_CONFIG\_OPTION\_GX\_VAR\_SUPPORT** defines whether to include or not support for Apple's distortable font technology (fvar, gvar, cvar, and avar tables).
- **FREETYPE2\_OPT\_TT\_CONFIG\_OPTION\_MAX\_RUNNABLE\_OPCODES** defines the maximum number of bytecode instructions executed for a single run of the bytecode interpreter, needed to prevent infinite loops.
- **FREETYPE2\_OPT\_TT\_CONFIG\_OPTION\_POSTSCRIPT\_NAMES** defines whether or not to load and enumerate the glyph Postscript names in a TrueType or OpenType file.
- **FREETYPE2\_OPT\_TT\_CONFIG\_OPTION\_SFNT\_NAMES** enables the application to access the internal name table in a SFNT-based format like TrueType or OpenType.   
    FREETYPE2\_OPT\_TT\_CONFIG\_OPTION\_SUBPIXEL\_HINTING defines whether to compile or not subpixel hinting support into the TrueType driver.

# Other flags

- **CGICODECHECK\_PC\_LINT\_CONFIG\_DIR** sets the full path to the directory containing PC-Lint configuration files.
- **CGICODECHECK\_PC\_LINT\_CUSTOM** enables custom rules for linting.
- **CGICODECHECK\_PC\_LINT\_CUSTOM\_CONFIG\_PATH** sets the full path to the custom PC-Lint configuration directory.
- **CGICODECHECK\_PC\_LINT\_ENABLED** defines whether or not enabling PC-Lint code checks.
- **CGICODECHECK\_PC\_LINT\_EXECUTABLE\_PATH** sets the full path to the PC-Lint executable, NOT to the generated lin.bat.
- **CGIDEVICE\_RCARD1\_USE\_DRW2D** can be used to switch between using the Draw 2D API for DaveHD or using 2D over 2D using OpenGL directly.
- **CGISTUDIO\_BUILD\_LUA** define whether or not the LUA library is enabled.
- **CMAKE\_CONFIGURATION\_TYPES** defines a semicolon separated list of supported configuration types: Debug, Release, MinSizeRel and RelWithDebInfo. Anything else will be ignored.
- **CMAKE\_INSTALL\_PREFIX** sets the install path prefix, prepended onto install directories.
- **CMAKE\_VERBOSE\_CGISTUDIO\_LOG** defines whether or not printing CGI-Studio Cmake debug logs.
- **SCHOST\_BASE\_PATH** sets the location of cgi\_studio\_schost.
- **CMAKE\_AR** defines path to “ar” (compiler archiver)
- **CMAKE\_ASM\_FLAGS** defines compilation flags to get support for assembler via compiler
- **CMAKE\_BUILD\_TYPE** defines the built type (Debug, Release …)
- **CMAKE\_COLOR\_MAKEFILE** enables color output when using the Makefile generator
- **CMAKE\_LINKER** defines the path for linker
- **CMAKE\_MAKE\_PROGRAM** defines the path to the native build system
- **CMAKE\_NM** defines the path to "nm" (a tool used to examine binary files)
- **CMAKE\_OBJCOPY** defines the path to “objcopy" (utility that copies an object file to another)
- **CMAKE\_OBJDUMP** defines the path to “objdump” (objdump displays information about one or more object files)
- **CMAKE\_PROJECT\_NAME** defines the name of the current project
- **CMAKE\_SH** defines the path to “sh”
- **CMAKE\_SKIP\_INSTALL\_RPATH** defines whether include or not RPATHs in the install tree
- **CMAKE\_SKIP\_RPATH** defines whether add or not run time path information
- **CMAKE\_STATIC\_LINKER\_FLAGS** defines the linker flags to be used to create static libraries
- **CMAKE\_STATIC\_LINKER\_FLAGS\_DEBUG** defines the flags used by the linker during debug builds
- **CMAKE\_STATIC\_LINKER\_FLAGS\_MINSIZEREL** defines the flags used by the linker during release minsize builds
- **CMAKE\_STATIC\_LINKER\_FLAGS\_RELEASE** defines the flags used by the linker during release builds
- **CMAKE\_STATIC\_LINKER\_FLAGS\_RELWITHDEBINFO** defines the flags used by the linker during Release with Debug Info builds
- **CMAKE\_STRIP** defines the path to the “strip” utility (removes inessential information from executable binary programs and object files)
- **CMAKE\_TOOLCHAIN\_FILE** defines the path to the toolchain file (it contains paths to the utilities to compile, link libraries and create archives, and other tasks to drive the build)
- **CMAKE\_VERBOSE\_MAKEFILE** defines whether enable or disable verbose output from Makefile builds
- **CMAKE\_CXX\_FLAGS\_DEBUG** defines the CXX debug flags.
- **CMAKE\_CXX\_FLAGS\_MINSIZEREL** defines the CXX Minimum Size Release Flags
- **CMAKE\_CXX\_FLAGS\_RELEASE** defines the CXX release flags.
- **CMAKE\_CXX\_FLAGS\_RELWITHDEBINFO** defines the CXX release with debug info flags.
- **CMAKE\_C\_FLAGS\_DEBUG** defines the C debug flags.
- **CMAKE\_C\_FLAGS\_MINSIZEREL** defines the C minimum size release flags.
- **CMAKE\_C\_FLAGS\_RELEASE** defines the C release flags.
- **CMAKE\_C\_FLAGS\_RELWITHDEBINFO** defines the C release with debug info flags.
- **CMAKE\_RC\_COMPILER** defines path to the resource compiler.
- **FEATSTD\_\_FILE\_\_** defines the “\_\_FILE\_\_” macro (for some special gcc build it could be set to ‘\_\_BASE\_FILE\_\_’)
- **INTEGRITY\_OS\_PATH** defines the root path to Integrity OS installation.
- **MLC\_SIMULATION** defines whether to build or not the project without statemachine and allow direct connection to Matlab.
- **MULTI\_TOOLCHAIN\_PATH** defines the Root path to MULTI tool chain.
- PKG\_CONFIG\_EXECUTABLE
- **CMAKE\_INT\_FLAGS** defines the flags for the Integrate tool.
- **CMAKE\_INTEGRATE** defines the path to the Integrate tool (intex.exe).
- **CMAKE\_MEM** defines the path to the Gmem tool (gmemfile.exe).

# Candera Memory Pools Analysis

# Memory Pools Configuration

#### Introduction

If free memory in backing heap is exhausted, "Out of Memory" occurs. The possible reasons are as the below.

- Fragmentation of allocated blocks, not possible to fit in a new block.
- Initial analysis was wrong, configuration does not fit.
- “Unexpected” allocations.
- Executed use case cannot fit into supplied memory.

Please see the following pages:

- <span style="color: rgb(230, 126, 35);">[Memory Pool Configuration](https://doc316en.candera.eu/books/appendix-WCP/page/memory-pool-configuration)</span>
- <span style="color: rgb(230, 126, 35);">[“Unexpected” Allocations](https://doc316en.candera.eu/books/appendix-WCP/page/unexpected-allocations)</span>

# Memory Pool Configuration

#### Fragmentation

- A heap will fragment, when buffers with <span style="text-decoration: underline;">different lifetimes</span> get allocated
- Fragmentation endangers system stability over run time

<div drawio-diagram="3131"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-03/drawing-4-1678251879.png" alt=""/></div>

#### Heap Areas

- Permanent Allocation   
    
    - will never return the allocated block to the backing heap
    - will be managed by the associated bin (bin free list)
- Transient Allocation  
    
    - will immediately return the allocated block to the backing heap
- Two distinct memory areas
- The permanent area will <span style="text-decoration: underline;">never fragment</span>
- The transient area <span style="text-decoration: underline;">can fragment</span>

<div drawio-diagram="3132"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-03/drawing-4-1678251999.png" alt=""/></div>

#### Default Memory Pool Example

Let’s have a look on an example:

<div drawio-diagram="3139"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-03/drawing-4-1678255213.png" alt=""/></div>

<div drawio-diagram="3140"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-03/drawing-4-1678255251.png" alt=""/></div>

#### Memory Pool Example Outcome

- This configuration leads to fragmentation
- All flags (bin &amp; pool) are set to *None -&gt;* Allocations are always transient  
    
    - Transient allocations can fragment
    - <span style="text-decoration: underline;">When all allocations are transient, fragmentation is certain</span>
- Small Bin Limit is set to 128  
    
    - All allocations up to 128 take the best fit bin size + 4 Byte overhead
    - All allocations &gt; 128 take exactly the requested size + 8 Byte overhead
    - The configured bins &gt; 128 are not considered at all, they just consume their header memory

#### Interpret MemoryPoolAnalysis.xlsx

When a permanent block with size 12800 Byte is used for 160 Byte allocation…

**12800**  
 C:\\CGI-Studio\_3.10\\cgi\_studio\_candera\\src\\Candera\\Engine2D\\Core\\RenderNode.cpp(66)

- The default behavior of Memory Pool for allocations is:

1. 1. 1. Determine the bin according the requested buffer size
        2. Check the free list of the identified bin
        3. If no block is found in the free list, try to allocate a buffer from the backing heap.
        4. If the allocation from the backing heap fails, try to allocate from the next larger bins (overflow).

- In the example above, step 4 occurred -&gt; Allocation of a new bin failed!

#### Proper Memory Pool Analysis

- A proper configuration for initial analysis…
- has a “small bin limit” of 4 Byte  
    
    - All allocations shall take the requested size
- defines *PermanentOnly* flag on the pool  
    
    - Bins shall be reused (freed blocks are returned to bin free list)
- defines additionally *NoOverflow* flag on the pool  
    
    - inhibit overflow allocations
    - If specified, allocation requests from a bin will never overflow to a larger bin
    - Note: a test run with this flag might fail (Out of memory…) due to many unused blocks -&gt; in this case remove the flag

#### Proper Memory Pool Configuration

- A proper final Memory Pool configuration…
- has a “small bin limit” in the upper area (where allocations are rarely)  
    
    - Keep number of transient allocations to a minimum
- uses Flags on bins instead of the pool  
    
    - defines *PermanentOnly* flag on small bins
    - Defines one bin with None flag, uses transient allocations for large blocks, which are rarely used (no reuse intended)
- uses few bins  
    
    - balance wasted space vs. unused (rarely used) blocks

#### Wasted Space vs. Unused blocks

- Many permanent bins leads to many unused blocks  
    
    - free blocks in bin free list
- Few permanent bins leads to memory “waste” in blocks  
    
    - Allocation request smaller than block size
- The memory “waste” of few bins is smaller than free blocks from too many bins.  
    
    - Free bin blocks are reused more often

<div drawio-diagram="3133"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-03/drawing-4-1678252820.png" alt=""/></div>

#### Process of Configuration

- Take dumps with proper configuration for analysis  
    
    - Play more than one use case to get better data
- If it is not possible to run with flag *NoOverflow* …  
    
    - Remove the flag
    - Analysis is still valid, most overflows come from low size bins which are anyway “dense”
- Based on the results  
    
    - Reduce the number of bins drastically
    - Choose a “small bin limit” where allocations are temporary requests Release of temporary memory vs. fragmentation

#### Reduce Number of Bins

Reduce the number of bins generously  
Too many bins -&gt; many free blocks not used  
“Wasted Space” &lt; Not used blocks!

<div drawio-diagram="3134"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-03/drawing-4-1678253010.png" alt=""/></div>

#### Choose “Small Bin Limit”

- Remember: Avoid non used blocks!
- Summarize bins to small bins as far as possible
- “Small Bin Limit” shall start where allocations are temporary requests and fragmentation is more unlikely

<div drawio-diagram="3137"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-03/drawing-4-1678254380.png" alt=""/></div>

#### Result

<div drawio-diagram="3138"><img src="https://doc316en.candera.eu/uploads/images/drawio/2023-03/drawing-4-1678254563.png" alt=""/></div>

#### Advanced Topics

- Pre-Allocation  
    
    - Define how many permanent blocks shall be pre-allocated in each bin
- Combine with OverflowPreferred flag on bins  
    
    - first try to overflow and then allocate from the backing heap
    - Limit overflows by adding flag OverflowBarrier to bin configuration
    - Such a configuration might improve the memory layout
- A sophisticated out of memory function could trigger the release of unneeded memory  
    
    - Return value controls if the allocation request will be repeated or abandoned

# “Unexpected” Allocations

#### VRAM Memory Pool

- \[Applicable for platforms Traveo, Traveo II, RH850\]
- Why in the VRAM 4 buffers are allocated for render buffers of a single Render Target?
- What happens:  
    
    - During a transition first scene is unloaded, next scene is loaded
    - In case of startup, the first scene is the only one existing
    - Default Behavior of Courier:   
        
        - when the last View on a Render Target is unloaded, the Render Target is also unloaded
    - The VramAllocator does never immediately free the memory, because the GPU might still write to it (Note: GPU runs
    - asynchronously to the CPU)
    - -&gt; New 2 buffers are allocated when the second scene is loaded
- How to fix it?
- Send on startup a ViewPlaceholderReqMsg  
    
    - increases the reference counter on Render target.
    - The message has two parameters
    - ViewId: this is a "reference" view which is used to determine the render target object
    - Load: true means to increase the reference count, false would decrease it (removes this placeholder from the internal list)
- Alternatively, you can also use a dummy scene with just a camera  
    
    - This view would be always active and never unloaded.

#### Asset Cache

- From the Memory Pool Analysis Sheet:

**16384**  
C:\\CGI-Studio\_3.10\\cgi\_studio\_candera\\src\\CanderaAssetLoader\\AssetLoaderBase\\AssetCache.cpp(38)

- -&gt; This is the cache used by the Asset Loader when copying images from flash to RAM
- Most or all images are directly rendered from flash
- The cache size is best practice for many platforms, but not when flash is directly accessible!
- -&gt; Proposal: If flash is directly accessible, reduce the cache  
    
    - E.g., to 1 kB (you win 15 kB!)
- CMake flag CANDERA\_ASSET\_CACHE\_SIZE