| # 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 = [ |
| ":arc-networkd", |
| ":libarcnetwork", |
| ":libarcnetwork-util", |
| ] |
| if (use.test) { |
| deps += [ ":arc_network_testrunner" ] |
| } |
| } |
| |
| pkg_config("target_defaults") { |
| pkg_deps = [ |
| "libbrillo-${libbase_ver}", |
| "libchrome-${libbase_ver}", |
| "libndp", |
| "libshill-client", |
| "libshill-net-${libbase_ver}", |
| "protobuf-lite", |
| ] |
| } |
| |
| proto_library("protos") { |
| configs = [ ":target_defaults" ] |
| proto_in_dir = "." |
| proto_out_dir = "include/arc/network" |
| sources = [ |
| "${proto_in_dir}/ipc.proto", |
| ] |
| } |
| |
| util_sources = [ |
| "mac_address_generator.cc", |
| "subnet.cc", |
| "subnet_pool.cc", |
| ] |
| |
| shared_library("libarcnetwork-util") { |
| configs += [ ":target_defaults" ] |
| sources = util_sources |
| } |
| |
| static_library("libarcnetwork") { |
| configs += [ ":target_defaults" ] |
| sources = [ |
| "arc_ip_config.cc", |
| "device.cc", |
| "device_manager.cc", |
| "dns/big_endian.cc", |
| "dns/dns_response.cc", |
| "dns/io_buffer.cc", |
| "helper_process.cc", |
| "ip_helper.cc", |
| "manager.cc", |
| "minijailed_process_runner.cc", |
| "multicast_forwarder.cc", |
| "multicast_socket.cc", |
| "ndp_handler.cc", |
| "neighbor_finder.cc", |
| "router_finder.cc", |
| "scoped_ns.cc", |
| "shill_client.cc", |
| ] |
| sources += util_sources |
| deps = [ |
| ":protos", |
| ] |
| } |
| |
| executable("arc-networkd") { |
| configs += [ ":target_defaults" ] |
| sources = [ |
| "main.cc", |
| ] |
| deps = [ |
| ":libarcnetwork", |
| ] |
| } |
| |
| if (use.test) { |
| pkg_config("test_config") { |
| pkg_deps = [ "libchrome-test-${libbase_ver}" ] |
| } |
| |
| executable("arc_network_testrunner") { |
| configs += [ |
| "//common-mk:test", |
| ":target_defaults", |
| ":test_config", |
| ] |
| sources = [ |
| "arc_ip_config_test.cc", |
| "device_manager_test.cc", |
| "device_test.cc", |
| "mac_address_generator_test.cc", |
| "minijailed_process_runner_test.cc", |
| "shill_client_test.cc", |
| "subnet_pool_test.cc", |
| "subnet_test.cc", |
| ] |
| defines = [ "UNIT_TEST" ] |
| deps = [ |
| ":libarcnetwork", |
| "//common-mk/testrunner", |
| ] |
| } |
| } |