From 4ec751ded6dfd71f5ec17e735868364c8d868ccc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20H=C3=A9rilier?= Date: Thu, 19 Sep 2024 16:18:10 +0200 Subject: [PATCH] taocpp-json: add taoJSON version 1.0.0-beta.14 --- releases.json | 8 ++ .../packagefiles/taocpp-json/meson.build | 28 ++++++ .../packagefiles/taocpp-json/meson.options | 18 ++++ .../taocpp-json/src/example/json/meson.build | 58 ++++++++++++ .../taocpp-json/src/perf/json/meson.build | 33 +++++++ .../taocpp-json/src/test/json/meson.build | 89 +++++++++++++++++++ subprojects/taocpp-json.wrap | 9 ++ 7 files changed, 243 insertions(+) create mode 100644 subprojects/packagefiles/taocpp-json/meson.build create mode 100644 subprojects/packagefiles/taocpp-json/meson.options create mode 100644 subprojects/packagefiles/taocpp-json/src/example/json/meson.build create mode 100644 subprojects/packagefiles/taocpp-json/src/perf/json/meson.build create mode 100644 subprojects/packagefiles/taocpp-json/src/test/json/meson.build create mode 100644 subprojects/taocpp-json.wrap diff --git a/releases.json b/releases.json index e33fc8846..2baf5bc18 100644 --- a/releases.json +++ b/releases.json @@ -3439,6 +3439,14 @@ "1.12-1" ] }, + "taocpp-json": { + "dependency_names": [ + "taocpp-json" + ], + "versions": [ + "1.0.0-beta.14-1" + ] + }, "tclap": { "dependency_names": [ "tclap" diff --git a/subprojects/packagefiles/taocpp-json/meson.build b/subprojects/packagefiles/taocpp-json/meson.build new file mode 100644 index 000000000..9fde4964f --- /dev/null +++ b/subprojects/packagefiles/taocpp-json/meson.build @@ -0,0 +1,28 @@ +project( + 'taocpp-json', + 'cpp', + version: '1.0.0-beta.14', + license: 'MIT', + default_options: [ + 'cpp_std=c++17', + ] +) + +pegtl_dep = dependency('pegtl') + +taocpp_json_inc = include_directories('include') +taocpp_json_dep = declare_dependency(include_directories: [taocpp_json_inc], dependencies: [pegtl_dep]) + +is_subproject = meson.is_subproject() + +if get_option('tests').disable_auto_if(is_subproject).allowed() + subdir('src/test/json') +endif + +if get_option('examples').disable_auto_if(is_subproject).allowed() + subdir('src/example/json') +endif + +if get_option('perfs').disable_auto_if(is_subproject).allowed() + subdir('src/perf/json') +endif diff --git a/subprojects/packagefiles/taocpp-json/meson.options b/subprojects/packagefiles/taocpp-json/meson.options new file mode 100644 index 000000000..e8dd2e540 --- /dev/null +++ b/subprojects/packagefiles/taocpp-json/meson.options @@ -0,0 +1,18 @@ +option( + 'tests', + type: 'feature', + value: 'auto', + description: 'Build test programs', +) +option( + 'examples', + type: 'feature', + value: 'auto', + description: 'Build example programs', +) +option( + 'perfs', + type: 'feature', + value: 'auto', + description: 'Build perf programs', +) diff --git a/subprojects/packagefiles/taocpp-json/src/example/json/meson.build b/subprojects/packagefiles/taocpp-json/src/example/json/meson.build new file mode 100644 index 000000000..0d611a7c1 --- /dev/null +++ b/subprojects/packagefiles/taocpp-json/src/example/json/meson.build @@ -0,0 +1,58 @@ +example_files = [ + 'cbor_to_jaxn.cpp', + 'cbor_to_json.cpp', + 'cbor_to_msgpack.cpp', + 'cbor_to_pretty_jaxn.cpp', + 'cbor_to_pretty_json.cpp', + 'cbor_to_ubjson.cpp', + 'jaxn_to_cbor.cpp', + 'jaxn_to_cplusplus.cpp', + 'jaxn_to_jaxn.cpp', + 'jaxn_to_msgpack.cpp', + 'jaxn_to_pretty_jaxn.cpp', + 'jaxn_to_ubjson.cpp', + 'json_to_cbor.cpp', + 'json_to_json.cpp', + 'json_to_msgpack.cpp', + 'json_to_pretty_json.cpp', + 'json_to_ubjson.cpp', + 'msgpack_to_cbor.cpp', + 'msgpack_to_jaxn.cpp', + 'msgpack_to_json.cpp', + 'msgpack_to_pretty_jaxn.cpp', + 'msgpack_to_pretty_json.cpp', + 'msgpack_to_ubjson.cpp', + 'printf_doubles.cpp', + 'ubjson_to_cbor.cpp', + 'ubjson_to_jaxn.cpp', + 'ubjson_to_json.cpp', + 'ubjson_to_msgpack.cpp', + 'ubjson_to_pretty_jaxn.cpp', + 'ubjson_to_pretty_json.cpp', + 'validate_event_order.cpp', + 'validate_integer.cpp', +] + +args = [] +cpp = meson.get_compiler('cpp') + +if cpp.get_argument_syntax() == 'msvc' + args += cpp.get_supported_arguments('/W4', '/WX', '/utf-8') +else + args += cpp.get_supported_arguments('-pedantic', '-Wall', '-Wextra', '-Wshadow', '-Werror') +endif + +fs = import('fs') + +foreach file : example_files + + name = fs.replace_suffix(file, '') + + example_exe = executable( + name, + files(file), + dependencies: pegtl_dep, + cpp_args: args, + ) + +endforeach diff --git a/subprojects/packagefiles/taocpp-json/src/perf/json/meson.build b/subprojects/packagefiles/taocpp-json/src/perf/json/meson.build new file mode 100644 index 000000000..93a904361 --- /dev/null +++ b/subprojects/packagefiles/taocpp-json/src/perf/json/meson.build @@ -0,0 +1,33 @@ +perf_files = [ + 'benchmark.cpp', + 'parse_file.cpp', + 'pretty_print_file.cpp', + 'print_double.cpp', + 'print_file.cpp', + 'sizes.cpp', + 'syntax_only.cpp', +] + +args = [] +cpp = meson.get_compiler('cpp') + +if cpp.get_argument_syntax() == 'msvc' + args += cpp.get_supported_arguments('/W4', '/WX', '/utf-8') +else + args += cpp.get_supported_arguments('-pedantic', '-Wall', '-Wextra', '-Wshadow', '-Werror') +endif + +fs = import('fs') + +foreach file : perf_files + + name = fs.replace_suffix(file, '') + + perf_exe = executable( + name, + files(file), + dependencies: pegtl_dep, + cpp_args: args, + ) + +endforeach diff --git a/subprojects/packagefiles/taocpp-json/src/test/json/meson.build b/subprojects/packagefiles/taocpp-json/src/test/json/meson.build new file mode 100644 index 000000000..9f220f76c --- /dev/null +++ b/subprojects/packagefiles/taocpp-json/src/test/json/meson.build @@ -0,0 +1,89 @@ +test_files = [ + 'big_list_of_naughty_strings.cpp', + 'binding_array.cpp', + 'binding_factory.cpp', + 'binding_function.cpp', + 'binding_object.cpp', + 'binding_versions.cpp', + 'cbor.cpp', + 'cbor_parts_parser.cpp', + 'contrib_diff.cpp', + 'contrib_get.cpp', + 'contrib_patch_add.cpp', + 'contrib_patch_copy.cpp', + 'contrib_patch_move.cpp', + 'contrib_patch_remove.cpp', + 'contrib_patch_replace.cpp', + 'contrib_patch_test.cpp', + 'contrib_position.cpp', + 'contrib_reference.cpp', + 'contrib_schema.cpp', + 'contrib_traits.cpp', + 'double.cpp', + 'enable_implicit_constructor.cpp', + 'escape.cpp', + 'events_binary_to.cpp', + 'events_compare.cpp', + 'events_debug.cpp', + 'events_hash.cpp', + 'events_to_stream.cpp', + 'events_to_string.cpp', + 'include_json.cpp', + 'integer.cpp', + 'jaxn_ostream.cpp', + 'jaxn_parse.cpp', + 'jaxn_parts_parser.cpp', + 'json_ostream.cpp', + 'json_parse.cpp', + 'json_parts_parser.cpp', + 'json_pointer.cpp', + 'key_camel_case_to_snake_case.cpp', + 'key_snake_case_to_camel_case.cpp', + 'literal.cpp', + 'msgpack.cpp', + 'object_construction.cpp', + 'opaque_pointer.cpp', + 'operators.cpp', + 'optional.cpp', + 'public_base.cpp', + 'self_contained.cpp', + 'sha256.cpp', + 'temporary_parsing.cpp', + 'type.cpp', + 'ubjson.cpp', + 'uri_fragment.cpp', + 'validate_event_interfaces.cpp', + 'validate_utf8.cpp', + 'value_access.cpp', + 'value_basics.cpp', + 'value_create.cpp', + 'value_ptr.cpp', + 'value_subscript.cpp', + 'with_arguments.cpp', +] + +args = [] +cpp = meson.get_compiler('cpp') + +if cpp.get_argument_syntax() == 'msvc' + args += cpp.get_supported_arguments('/W4', '/WX', '/utf-8') +else + args += cpp.get_supported_arguments('-pedantic', '-Wall', '-Wextra', '-Wshadow', '-Werror') +endif + +fs = import('fs') + +foreach file : test_files + + name = fs.replace_suffix(file, '') + + test_exe = executable( + name, + files(file), + dependencies: pegtl_dep, + cpp_args: args, + ) + + test(name, test_exe, workdir: meson.project_source_root()) + +endforeach diff --git a/subprojects/taocpp-json.wrap b/subprojects/taocpp-json.wrap new file mode 100644 index 000000000..4955a1b9f --- /dev/null +++ b/subprojects/taocpp-json.wrap @@ -0,0 +1,9 @@ +[wrap-file] +directory = json-1.0.0-beta.14 +source_url = https://github.com/taocpp/json/archive/refs/tags/1.0.0-beta.14.tar.gz +source_filename = taocpp-json-1.0.0-beta.14.tar.gz +source_hash = f9e44a1d6a70a6d39b9e45df76eac928e69f5318e5a957fd5c0efdf45dacaf5e +patch_directory = taocpp-json + +[provide] +taocpp-json = taocpp_json_dep