Setting JSON_DisableEnumSerialization to ON when building JSON for Modern C++ with testing enabled (JSON_BuildTests set also set to ON), the tests do not build and the build fails. Tests that rely on that setting should not be built for library clients who do not want EnumSerialization and the build should succeed.
Reproduction steps
From a fresh clone of nlohmann/json, I ran the following commands to configure and build the library using CMake:
I expect successful building and linking of all executable tests with no errors or warnings. In practice, the compiler produces errors and warnings as detailed below in the Error messages field in this form.
Description
Setting
JSON_DisableEnumSerialization
toON
when building JSON for Modern C++ with testing enabled (JSON_BuildTests
set also set toON
), the tests do not build and the build fails. Tests that rely on that setting should not be built for library clients who do not want EnumSerialization and the build should succeed.Reproduction steps
From a fresh clone of nlohmann/json, I ran the following commands to configure and build the library using CMake:
Expected vs. actual results
I expect successful building and linking of all executable tests with no errors or warnings. In practice, the compiler produces errors and warnings as detailed below in the Error messages field in this form.
Minimal code example
Error messages
Compiler and operating system
gcc12, Ubuntu 22.04.1 x86_64
Library version
3.11.2
Validation
develop
branch is used.