The following options can be configured to control or optimize Fiber behavior. They must be set before the library is added via CPM, FetchContent, or add_subdirectory.
set them in CMake via:
set(<definition> [ON|OFF] CACHE BOOL "" FORCE)
and replace <definition> with one of the following flags, as well as [ON|OFF] wether you want it turned ON or OFF.
The library also defines "weak `ON`". They are only ON as long as no other option with the same prefix is ON. This means you do not manully have to turn them OFF.
Tests
| Definition | Description | Default value |
FIBER_CTEST | Inables testing with ctest on local host machines | OFF |
FIBER_COMPILE_TESTS | If ON compiles the test sources | OFF |
System Stubs
| Definition | Description | Default value |
FIBER_USE_SYS_STUBS | Enables system stubs that prevent the usage of unnecessary standard library features and massively reduces binary size | OFF |
Exceptions and Assertions
| Definition | Description | Default value |
FIBER_DISABLE_EXCEPTIONS | Disables exceptions, will also disable assertions | OFF |
FIBER_DISABLE_ASSERTIONS | Disable all Fiber assertions | OFF |
FIBER_ASSERTION_LEVEL_CRITICAL | Enable critical level assertions | weak ON |
FIBER_ASSERTION_LEVEL_O1 | Enable O[1] cost development assertions + critical | default: OFF |
FIBER_ASSERTION_LEVEL_FULL | Enable full deep validation assertions + O[1] + full | default: OFF |
FIBER_ASSERTS_AS_ASSUME | Use compiler intrinsics that asume values instead of unused asserts - for more optimisations (like __builtin_assume, or a different, or none - depending on the compiler used) | OFF |
FIBER_USE_EXCEPTION_CALLBACKS | Use user-defined callbacks for exceptions instead of throwing them | OFF |
Encodings
| Definition | Description | Default value |
FIBER_DISABLE_ANSI_CODES | Enables ANSI escape codes in stream output. For example to color terminal text | OFF |
FIBER_DISABLE_UTF8_CODES | Enables UTF8 codes, for exampample lines and borders, if OFF, uses ASCII alternatives | OFF |
Formating
| Definition | Description | Default value |
FIBER_FMT_MINIMAL | If ON: uses the settings from the macros instead. This disables runtime configurability but offers more performant code and smaller binaries | OFF |
| Bool Formating | | |
FIBER_FMT_BOOL_TO_TEXT | If FIBER_FMT_MINIMAL is ON: Enables bool formating as text instead of numbers. | ON |
| Number Formating | | |
FIBER_FMT_PAD_SIGN | If FIBER_FMT_MINIMAL is ON: Enables sign padding. | OFF |
FIBER_FMT_DOT_AS_COMMA | If FIBER_FMT_MINIMAL is ON: Use dot '.' as comma and ',' as thousands. | ON |
FIBER_FMT_THOUSANDS | If FIBER_FMT_MINIMAL is ON: Enables the use of thousands. Depends on FIBER_FMT_DOT_AS_COMMA. | OFF |
FIBER_FMT_FORCE_SIGN | If FIBER_FMT_MINIMAL is ON: forces a sign, even if the number is positive. | OFF |
FIBER_FMT_FORCE_COMMA | If FIBER_FMT_MINIMAL is ON: if set, makes sure that a comma is always printed for floating point numbers. | ON |
FIBER_FMT_FORCE_DECIMALS | If FIBER_FMT_MINIMAL is ON: if set will make sure that the set ammount of decimals will always be printed, even if zero. | OFF |
FIBER_FMT_FORCE_SIGN | If FIBER_FMT_MINIMAL is ON: forces a sign, even if the number is positive. | OFF |
| Float Formating | | |
FIBER_FMT_FORCE_EXPONENT | If FIBER_FMT_MINIMAL is ON: forces an exponent, even if the exponent is zero. | OFF |
FIBER_FMT_FORCE_EXPONENT_SIGN | If FIBER_FMT_MINIMAL is ON: forces a sign on the exponent, even if the exponent is positive. | OFF |
FIBER_FMT_FLOAT_DECIMALS_1 | If FIBER_FMT_MINIMAL is ON: Enables 1 decimal place. | OFF |
FIBER_FMT_FLOAT_DECIMALS_2 | If FIBER_FMT_MINIMAL is ON: Enables 2 decimal places. | OFF |
FIBER_FMT_FLOAT_DECIMALS_3 | If FIBER_FMT_MINIMAL is ON: Enables 3 decimal places. | weak ON |
FIBER_FMT_FLOAT_DECIMALS_4 | If FIBER_FMT_MINIMAL is ON: Enables 4 decimal places. | OFF |
FIBER_FMT_FLOAT_DECIMALS_5 | If FIBER_FMT_MINIMAL is ON: Enables 5 decimal places. | OFF |
FIBER_FMT_FLOAT_DECIMALS_6 | If FIBER_FMT_MINIMAL is ON: Enables 6 decimal places. | OFF |
FIBER_FMT_FLOAT_REP_SCI | If FIBER_FMT_MINIMAL is ON: Enables scientific representation. | OFF |
FIBER_FMT_FLOAT_REP_ENG | If FIBER_FMT_MINIMAL is ON: Enables engineering representation. | weak ON |
FIBER_FMT_FLOAT_REP_FULL | If FIBER_FMT_MINIMAL is ON: Enables floating point representation. | OFF |