| # Copyright 2018 The Fuchsia Authors. All rights reserved. | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| # Do not use - depend directly on //src/lib/json_parser instead. | |
| # This is a transitional target and will be removed soon. | |
| # Bug: 36759 | |
| group("json") { | |
| public_deps = [ ":json_parser" ] | |
| } | |
| source_set("json_parser") { | |
| sources = [ | |
| "json_parser.cc", | |
| "json_parser.h", | |
| "pretty_print.h", | |
| "rapidjson_validation.cc", | |
| "rapidjson_validation.h", | |
| ] | |
| public_deps = [ | |
| "//src/lib/fxl", | |
| "//zircon/public/lib/fbl", | |
| "//zircon/public/lib/fit", | |
| "//zircon/public/lib/zxc", | |
| # TODO(fxbug.dev/57392): Move it back to //third_party once unification completes. | |
| "//zircon/third_party/rapidjson", | |
| ] | |
| } | |
| executable("json_parser_unittests_bin") { | |
| testonly = true | |
| output_name = "json_parser_unittests" | |
| sources = [ | |
| "json_parser_unittest.cc", | |
| "rapidjson_validation_unittest.cc", | |
| ] | |
| deps = [ | |
| ":json_parser", | |
| "//src/lib/files", | |
| "//src/lib/fxl", | |
| "//src/lib/fxl/test:gtest_main", | |
| # TODO(fxbug.dev/57392): Move it back to //third_party once unification completes. | |
| "//zircon/third_party/rapidjson", | |
| ] | |
| # TODO(fxbug.dev/46748): Fix the leaks and remove this. | |
| deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] | |
| configs += [ | |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings | |
| "//build/config:Wno-conversion", | |
| ] | |
| } | |
| if (is_fuchsia) { | |
| import("//build/test/test_package.gni") | |
| import("//build/testing/environments.gni") | |
| test_package("json_parser_unittests") { | |
| deps = [ ":json_parser_unittests_bin" ] | |
| tests = [ | |
| { | |
| name = "json_parser_unittests" | |
| environments = [ emu_env ] | |
| }, | |
| ] | |
| } | |
| } | |
| group("tests") { | |
| testonly = true | |
| deps = [ ":json_parser_unittests_bin($host_toolchain)" ] | |
| if (is_fuchsia) { | |
| deps += [ ":json_parser_unittests" ] | |
| } | |
| } |