| # Copyright 2018 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//common-mk/pkg_config.gni") |
| import("//common-mk/proto_library.gni") |
| |
| group("all") { |
| deps = [ |
| ":server_proxy", |
| ] |
| if (use.test) { |
| deps += [ |
| ":client_proxy_lib", |
| ":vsock_proxy_test", |
| ] |
| } |
| } |
| |
| pkg_config("target_defaults") { |
| pkg_deps = [ |
| "libchrome-${libbase_ver}", |
| "libbrillo-${libbase_ver}", |
| "protobuf", |
| ] |
| } |
| |
| proto_library("message") { |
| proto_in_dir = "." |
| proto_out_dir = "include/arc/vm/vsock_proxy" |
| sources = [ |
| "${proto_in_dir}/message.proto", |
| ] |
| } |
| |
| static_library("vsock_proxy_lib") { |
| configs += [ ":target_defaults" ] |
| pkg_deps = [ "fuse" ] |
| defines = [ "FUSE_USE_VERSION=26" ] |
| deps = [ |
| ":message", |
| ] |
| sources = [ |
| "file_descriptor_util.cc", |
| "file_stream.cc", |
| "pipe_stream.cc", |
| "proxy_service.cc", |
| "server_proxy.cc", |
| "server_proxy_file_system.cc", |
| "socket_stream.cc", |
| "vsock_proxy.cc", |
| "vsock_stream.cc", |
| ] |
| } |
| |
| executable("server_proxy") { |
| configs += [ ":target_defaults" ] |
| deps = [ |
| ":vsock_proxy_lib", |
| ] |
| |
| sources = [ |
| "server_proxy_main.cc", |
| ] |
| } |
| |
| if (use.test) { |
| # client_proxy is used only in VM guest, though build here for testing. |
| # TODO(b/121198129): Add actual unittest for those code. |
| # Currently, this exercises only that the library is successfully built. |
| static_library("client_proxy_lib") { |
| configs += [ ":target_defaults" ] |
| deps = [ |
| ":vsock_proxy_lib", |
| ] |
| sources = [ |
| "client_proxy.cc", |
| ] |
| } |
| |
| executable("vsock_proxy_test") { |
| configs += [ |
| "//common-mk:test", |
| ":target_defaults", |
| ] |
| |
| pkg_deps = [ |
| "libbrillo-test-${libbase_ver}", |
| "libchrome-test-${libbase_ver}", |
| ] |
| |
| deps = [ |
| ":vsock_proxy_lib", |
| "//common-mk/testrunner", |
| ] |
| |
| sources = [ |
| "file_descriptor_util_test.cc", |
| "file_stream_test.cc", |
| "pipe_stream_test.cc", |
| "proxy_service_test.cc", |
| "server_proxy_file_system_test.cc", |
| "socket_stream_test.cc", |
| "vsock_proxy_test.cc", |
| "vsock_stream_test.cc", |
| ] |
| } |
| } |