| # Copyright 2020 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. | |
| config("includes") { | |
| include_dirs = [ "src/include" ] | |
| } | |
| static_library("cppdap") { | |
| sources = [ | |
| "src/src/chan.h", | |
| "src/src/content_stream.cpp", | |
| "src/src/content_stream.h", | |
| "src/src/io.cpp", | |
| "src/src/json_serializer.h", | |
| "src/src/network.cpp", | |
| "src/src/null_json_serializer.cpp", | |
| "src/src/protocol_events.cpp", | |
| "src/src/protocol_requests.cpp", | |
| "src/src/protocol_response.cpp", | |
| "src/src/protocol_types.cpp", | |
| "src/src/rapid_json_serializer.cpp", | |
| "src/src/rwmutex.h", | |
| "src/src/session.cpp", | |
| "src/src/socket.cpp", | |
| "src/src/socket.h", | |
| "src/src/string_buffer.h", | |
| "src/src/typeinfo.cpp", | |
| "src/src/typeof.cpp", | |
| ] | |
| cflags = [ "-DCPPDAP_JSON_RAPID" ] | |
| # Suppress warnings that Fuchsia build adds | |
| configs += [ | |
| "//build/config:Wno-deprecated-this-capture", | |
| "//build/config:Wno-extra-semi", | |
| "//build/config:Wno-newline-eof", | |
| ] | |
| public_configs = [ ":includes" ] | |
| deps = [ "//third_party/rapidjson" ] | |
| } | |
| if (is_host) { | |
| executable("json_test") { | |
| testonly = true | |
| sources = [ | |
| "src/src/json_serializer_test.cpp", | |
| "src/src/null_json_serializer.cpp", | |
| "src/src/rapid_json_serializer.cpp", | |
| "src/src/typeinfo.cpp", | |
| "src/src/typeof.cpp", | |
| ] | |
| cflags = [ "-DCPPDAP_JSON_RAPID" ] | |
| public_configs = [ ":includes" ] | |
| deps = [ | |
| # TODO(https://fxbug.dev/57392): Move it back to //third_party once unification completes. | |
| "//src/lib/fxl/test:gtest_main", | |
| "//third_party/googletest:gmock", | |
| "//third_party/googletest:gtest", | |
| "//zircon/third_party/rapidjson", | |
| ] | |
| } | |
| } | |
| group("tests") { | |
| testonly = true | |
| deps = [ ":json_test($host_toolchain)" ] | |
| } |