diff options
Diffstat (limited to 'thirdparty/fmt/doc/api.md')
| -rw-r--r-- | thirdparty/fmt/doc/api.md | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/thirdparty/fmt/doc/api.md b/thirdparty/fmt/doc/api.md index 2c584abc0..9fbc9f2fe 100644 --- a/thirdparty/fmt/doc/api.md +++ b/thirdparty/fmt/doc/api.md @@ -708,3 +708,53 @@ following differences: `std::to_chars` which tries to generate the smallest number of characters (ignoring redundant digits and sign in exponent) and may procude more decimal digits than necessary. + +## Configuration Options + +{fmt} provides configuration via CMake options and preprocessor macros to +enable or disable features and to optimize for binary size. For example, you +can disable OS-specific APIs defined in `fmt/os.h` with `-DFMT_OS=OFF` when +configuring CMake. + +### CMake Options + +- **`FMT_OS`**: When set to `OFF`, disables OS-specific APIs (`fmt/os.h`). +- **`FMT_UNICODE`**: When set of `OFF`, disables Unicode support on + Windows/MSVC. Unicode support is always enabled on other platforms. + +### Macros + +- **`FMT_HEADER_ONLY`**: Enables the header-only mode when defined. It is an + alternative to using the `fmt::fmt-header-only` CMake target. + Default: not defined. + +- **`FMT_USE_EXCEPTIONS`**: Disables the use of exceptions when set to `0`. + Default: `1` (`0` if compiled with `-fno-exceptions`). + +- **`FMT_USE_LOCALE`**: When set to `0`, disables locale support. + Default: `1` (`0` when `FMT_OPTIMIZE_SIZE > 1`). + +- **`FMT_CUSTOM_ASSERT_FAIL`**: When set to `1`, allows users to provide a + custom `fmt::assert_fail` function which is called on assertion failures and, + if exceptions are disabled, on runtime errors. Default: `0`. + +- **`FMT_BUILTIN_TYPES`**: When set to `0`, disables built-in handling of + arithmetic and string types other than `int`. This reduces library size at + the cost of per-call overhead. Default: `1`. + +- **`FMT_OPTIMIZE_SIZE`**: Controls binary size optimizations: + - `0` - off (default) + - `1` - disables locale support and applies some optimizations + - `2` - disables some Unicode features, named arguments and applies more + aggresive optimizations + +### Binary Size Optimization + +To minimize the binary footprint of {fmt} as much as possible at the cost of +some features, you can use the following configuration: + +- CMake options: + - `FMT_OS=OFF` +- Macros: + - `FMT_BUILTIN_TYPES=0` + - `FMT_OPTIMIZE_SIZE=2` |