blob: 911349be27150b76c6a5990baf7f0af565d5b198 [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/generate-dbus-adaptors.gni")
import("//common-mk/pkg_config.gni")
group("all") {
deps = [
":featured",
":libfeatures",
":libfeatures_c",
]
if (use.test) {
deps += [
":c_feature_check_example",
":cpp_feature_check_example",
":feature_library_test",
":service_test",
]
}
if (use.fuzzer) {
deps += [ ":featured_json_feature_parser_fuzzer" ]
}
}
pkg_config("target_defaults") {
pkg_deps = [
"dbus-1",
"libbrillo",
"libchrome",
]
}
generate_dbus_adaptors("featured-adaptors") {
dbus_service_config = "dbus_bindings/dbus-service-config.json"
dbus_adaptors_out_dir = "include/featured/dbus_adaptors"
sources = [ "dbus_bindings/org.chromium.featured.xml" ]
}
static_library("libfeatured") {
sources = [ "service.cc" ]
configs += [ ":target_defaults" ]
deps = [
":featured-adaptors",
":libfeatures",
]
}
executable("featured") {
sources = [ "main.cc" ]
configs += [ ":target_defaults" ]
deps = [
":featured-adaptors",
":libfeatured",
]
}
shared_library("libfeatures") {
sources = [ "feature_library.cc" ]
configs += [ ":target_defaults" ]
}
shared_library("libfeatures_c") {
sources = [ "c_feature_library.cc" ]
configs += [ ":target_defaults" ]
deps = [ ":libfeatures" ]
}
if (use.test) {
pkg_config("test_helper_config") {
pkg_deps = [
"libbrillo",
"libbrillo-test",
"libchrome",
"libchrome-test",
]
}
executable("feature_library_test") {
sources = [ "feature_library_test.cc" ]
configs += [
"//common-mk:test",
":test_helper_config",
]
deps = [
":libfeatured",
":libfeatures",
"//common-mk/testrunner:testrunner",
]
}
executable("service_test") {
sources = [ "service_test.cc" ]
configs += [
"//common-mk:test",
":test_helper_config",
]
deps = [
":libfeatured",
"//common-mk/testrunner:testrunner",
]
}
executable("c_feature_check_example") {
sources = [ "c_feature_check_example.c" ]
deps = [ ":libfeatures_c" ]
}
executable("cpp_feature_check_example") {
sources = [ "cpp_feature_check_example.cc" ]
configs += [ ":test_helper_config" ]
deps = [ ":libfeatures" ]
}
}
if (use.fuzzer) {
executable("featured_json_feature_parser_fuzzer") {
sources = [ "json_feature_parser_fuzzer.cc" ]
configs += [
"//common-mk/common_fuzzer",
":target_defaults",
]
deps = [ ":libfeatured" ]
}
}