Skip to content

DPP_USE_EXTERNAL_JSON still uses internal JSON when building bots #1458

@benthetechguy

Description

@benthetechguy

Git commit reference
e97ae19 (10.1.2)

Describe the bug
In packaging this for Debian, I removed include/dpp/nlohmann and set -DDPP_USE_EXTERNAL_JSON=ON because Debian packages are supposed to use the packaged versions of libraries when possible.
When I build D++, it does in fact use the external nlohmann::json, but when I try to use it in a bot, it tries to include the internal JSON headers and not the external ones, unless I define DPP_USE_EXTERNAL_JSON in my bot's cmake.

To Reproduce
Steps to reproduce the behavior:

  1. Build D++ with -DDPP_USE_EXTERNAL_JSON=ON
  2. Build a bot using the D++ you just built
  3. Notice that it is including dpp/nlohmann/json.hpp rather than nlohmann/json.hpp, unless you also define DPP_USE_EXTERNAL_JSON in your bot.

Expected behavior
When D++ is built with -DDPP_USE_EXTERNAL_JSON=ON, the files include/dpp/json.h and include/dpp/json_fwd.h should be modified to include the external nlohmann::json rather than the internal one, rather than using a preprocessor directive to determine if that flag is set, because then that flag also has to be set for everything that uses D++, rather than sticking when it is used in the original D++ build.

System Details:

  • OS: Debian sid

Metadata

Metadata

Labels

StalebugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions