Skip to content

Commit

Permalink
meson: add support for the GlobalUDLs option
Browse files Browse the repository at this point in the history
Signed-off-by: Dylan Baker <[email protected]>
  • Loading branch information
dcbaker committed Jan 20, 2025
1 parent af894c3 commit a079ed8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ else
incdir = 'single_include'
endif

cpp_args = [
'-DJSON_USE_GLOBAL_UDLS=@0@'.format(
(not get_option('GlobalUDLs')).to_int()),
]

nlohmann_json_dep = declare_dependency(
compile_args: cpp_args,
include_directories: include_directories(incdir)
)
meson.override_dependency('nlohmann_json', nlohmann_json_dep)
Expand Down
6 changes: 6 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ option(
value: true,
description: 'Use non-amalgomated version of the library',
)
option(
'GlobalUDLs',
type: 'boolean',
value: true,
description: 'Place user-defined string literals in the global namespace',
)

0 comments on commit a079ed8

Please sign in to comment.