From 842e76ceb7843602ef81c09028a6602bb2a94e05 Mon Sep 17 00:00:00 2001 From: Florian Albrechtskirchinger Date: Sun, 26 Jun 2022 21:01:54 +0200 Subject: [PATCH] mkdocs: add CMake option hints to macros --- docs/mkdocs/docs/api/macros/json_diagnostics.md | 9 ++++++--- .../docs/api/macros/json_disable_enum_serialization.md | 8 ++++++++ .../docs/api/macros/json_use_implicit_conversions.md | 9 ++++++--- .../macros/json_use_legacy_discarded_value_comparison.md | 6 ++++++ 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/docs/mkdocs/docs/api/macros/json_diagnostics.md b/docs/mkdocs/docs/api/macros/json_diagnostics.md index c6a4dac3f..4fc0fc38e 100644 --- a/docs/mkdocs/docs/api/macros/json_diagnostics.md +++ b/docs/mkdocs/docs/api/macros/json_diagnostics.md @@ -11,9 +11,6 @@ When enabled, exception messages contain a [JSON Pointer](../json_pointer/json_p triggered the exception. Note that enabling this macro increases the size of every JSON value by one pointer and adds some runtime overhead. -The diagnostics messages can also be controlled with the CMake option `JSON_Diagnostics` (`OFF` by default) which sets -`JSON_DIAGNOSTICS` accordingly. - ## Default definition The default value is `0` (extended diagnostics are switched off). @@ -37,6 +34,12 @@ When the macro is not defined, the library will define it to its default value. Where possible, it is still recommended that all code define this the same way for maximum interoperability. +!!! hint "CMake option" + + Diagnostic messages can also be controlled with the CMake option + [`JSON_Diagnostics`](../../integration/cmake.md#json_diagnostics) (`OFF` by default) + which defines `JSON_DIAGNOSTICS` accordingly. + ## Examples ??? example "Example 1: default behavior" diff --git a/docs/mkdocs/docs/api/macros/json_disable_enum_serialization.md b/docs/mkdocs/docs/api/macros/json_disable_enum_serialization.md index 2bb4a724b..0240428ec 100644 --- a/docs/mkdocs/docs/api/macros/json_disable_enum_serialization.md +++ b/docs/mkdocs/docs/api/macros/json_disable_enum_serialization.md @@ -19,6 +19,14 @@ By default, `#!cpp JSON_DISABLE_ENUM_SERIALIZATION` is not defined. #undef JSON_DISABLE_ENUM_SERIALIZATION ``` +## Notes + +!!! hint "CMake option" + + Enum serialization can also be controlled with the CMake option + [`JSON_DisableEnumSerialization`](../../integration/cmake.md#json_disableenumserialization) + (`OFF` by default) which defines `JSON_DISABLE_ENUM_SERIALIZATION` accordingly. + ## Examples ??? example "Example 1: Disabled behavior" diff --git a/docs/mkdocs/docs/api/macros/json_use_implicit_conversions.md b/docs/mkdocs/docs/api/macros/json_use_implicit_conversions.md index 3ee81b061..adadffab6 100644 --- a/docs/mkdocs/docs/api/macros/json_use_implicit_conversions.md +++ b/docs/mkdocs/docs/api/macros/json_use_implicit_conversions.md @@ -7,9 +7,6 @@ When defined to `0`, implicit conversions are switched off. By default, implicit conversions are switched on. The value directly affects [`operator ValueType`](../basic_json/operator_ValueType.md). -Implicit conversions can also be controlled with the CMake option `JSON_ImplicitConversions` (`ON` by default) which -sets `JSON_USE_IMPLICIT_CONVERSIONS` accordingly. - ## Default definition By default, implicit conversions are enabled. @@ -27,6 +24,12 @@ By default, implicit conversions are enabled. You can prepare existing code by already defining `JSON_USE_IMPLICIT_CONVERSIONS` to `0` and replace any implicit conversions with calls to [`get`](../basic_json/get.md). +!!! hint "CMake option" + + Implicit conversions can also be controlled with the CMake option + [`JSON_ImplicitConversions`](../../integration/cmake.md#json_legacydiscardedvaluecomparison) + (`ON` by default) which defines `JSON_USE_IMPLICIT_CONVERSIONS` accordingly. + ## Examples ??? example diff --git a/docs/mkdocs/docs/api/macros/json_use_legacy_discarded_value_comparison.md b/docs/mkdocs/docs/api/macros/json_use_legacy_discarded_value_comparison.md index 072c044b3..bdb0a4607 100644 --- a/docs/mkdocs/docs/api/macros/json_use_legacy_discarded_value_comparison.md +++ b/docs/mkdocs/docs/api/macros/json_use_legacy_discarded_value_comparison.md @@ -56,6 +56,12 @@ When the macro is not defined, the library will define it to its default value. New code should not depend on it and existing code should try to remove or rewrite expressions relying on it. +!!! hint "CMake option" + + Legacy comparison can also be controlled with the CMake option + [`JSON_LegacyDiscardedValueComparison`](../../integration/cmake.md#json_legacydiscardedvaluecomparison) + (`OFF` by default) which defines `JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON` accordingly. + ## Examples ??? example