blob: c81ee115a7bf04d26b98330519e7ebf32e206659 [file] [log] [blame]
# Copyright 2021 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 = [
":dnsproxyd",
":libdnsproxy",
]
if (use.test) {
deps += [ ":dns-proxy_test" ]
}
}
pkg_config("target_defaults") {
# NOSORT
pkg_deps = [
"dbus-1",
"libbrillo",
"libchrome",
"libminijail",
"libpatchpanel-client",
"libpatchpanel-util",
"libshill-client",
"libshill-dbus-client",
# system_api depends on protobuf (or protobuf-lite). It must
# appear before protobuf or the linker flags won't be in the right
# order.
"system_api",
"protobuf-lite",
]
}
static_library("libdnsproxy") {
sources = [
"ares_client.cc",
"controller.cc",
"doh_curl_client.cc",
"proxy.cc",
"resolver.cc",
]
configs += [ ":target_defaults" ]
deps = []
}
executable("dnsproxyd") {
sources = [ "main.cc" ]
configs += [ ":target_defaults" ]
all_dependent_pkg_deps = [
"libcares",
"libcurl",
]
deps = [ ":libdnsproxy" ]
}
if (use.test) {
pkg_config("dns-proxy_test_config") {
pkg_deps = [
"libchrome",
"libchrome-test",
"libshill-client-test",
]
}
executable("dns-proxy_test") {
sources = [
"proxy_test.cc",
"resolver_test.cc",
]
configs += [
"//common-mk:test",
":dns-proxy_test_config",
":target_defaults",
]
defines = [ "UNIT_TEST" ]
all_dependent_pkg_deps = [
"libcares",
"libcurl",
]
deps = [
":libdnsproxy",
"//common-mk/testrunner:testrunner",
]
}
}