Skip to content

Commit

Permalink
Add nlohmann_json_io_dep that doesn't define JSON_NO_IO
Browse files Browse the repository at this point in the history
  • Loading branch information
pfirsich committed Nov 19, 2024
1 parent 63c9f01 commit 10ecb0d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/lib/nlohmann_json/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,23 @@ nlohmann_json = dependency('nlohmann_json',
required: get_variable('libcommon_enable_json', true))
if not nlohmann_json.found()
nlohmann_json_dep = nlohmann_json
nlohmann_json_io_dep = nlohmann_json
subdir_done()
endif

nlohmann_json_io = static_library(
'nlohmann_json_io',
'ToDisposableBuffer.cxx',
dependencies: nlohmann_json,
include_directories: inc,
)

# If you really need IO streams, you get this special dependency
nlohmann_json_io_dep = declare_dependency(
link_with: nlohmann_json_io,
dependencies: nlohmann_json,
)

nlohmann_json_dep = declare_dependency(
# no iostreams, please
compile_args: '-DJSON_NO_IO',
Expand Down

0 comments on commit 10ecb0d

Please sign in to comment.