diff --git a/meson.build b/meson.build index 077db3ab1..b3e51a501 100644 --- a/meson.build +++ b/meson.build @@ -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) diff --git a/meson_options.txt b/meson_options.txt index 0fc9d2e6b..27d3878ab 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -4,3 +4,9 @@ option( value: true, description: 'Use non-amalgamated version of the library', ) +option( + 'GlobalUDLs', + type: 'boolean', + value: true, + description: 'Place user-defined string literals in the global namespace', +)