| # 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 = [ |
| ":chromeos-config-protos", |
| ":cros_config", |
| ":cros_configfs", |
| ] |
| if (use.test) { |
| deps += [ |
| ":cros_config_main_test", |
| ":cros_config_test", |
| ":fake_cros_config_test", |
| ] |
| } |
| } |
| |
| pkg_config("target_defaults") { |
| pkg_deps = [ |
| "libchrome-${libbase_ver}", |
| "libbrillo-${libbase_ver}", |
| ] |
| } |
| |
| proto_library("chromeos-config-protos") { |
| proto_in_dir = "proto" |
| proto_out_dir = "include/chromeos-config/proto_bindings" |
| sources = [ |
| "${proto_in_dir}/identity_scan_config.proto", |
| ] |
| } |
| |
| shared_library("libcros_config") { |
| sources = [ |
| "libcros_config/configfs.cc", |
| "libcros_config/cros_config.cc", |
| "libcros_config/cros_config_fallback.cc", |
| "libcros_config/cros_config_impl.cc", |
| "libcros_config/cros_config_json.cc", |
| "libcros_config/fake_cros_config.cc", |
| "libcros_config/identity.cc", |
| "libcros_config/identity_arm.cc", |
| "libcros_config/identity_x86.cc", |
| ] |
| configs += [ ":target_defaults" ] |
| libs = [ "fdt" ] |
| } |
| |
| executable("cros_config") { |
| sources = [ |
| "cros_config_main.cc", |
| ] |
| configs += [ ":target_defaults" ] |
| deps = [ |
| ":libcros_config", |
| ] |
| } |
| |
| executable("cros_configfs") { |
| sources = [ |
| "cros_configfs_main.cc", |
| ] |
| configs += [ ":target_defaults" ] |
| deps = [ |
| ":libcros_config", |
| ] |
| } |
| |
| if (use.test) { |
| executable("cros_config_test") { |
| sources = [ |
| "libcros_config/cros_config_test.cc", |
| ] |
| configs += [ |
| "//common-mk:test", |
| ":target_defaults", |
| ] |
| include_dirs = [ "libcros_config" ] |
| deps = [ |
| ":libcros_config", |
| ] |
| } |
| |
| executable("cros_config_main_test") { |
| sources = [ |
| "cros_config_main_test.cc", |
| ] |
| configs += [ |
| "//common-mk:test", |
| ":target_defaults", |
| ] |
| deps = [ |
| ":cros_config", |
| ] |
| } |
| |
| executable("fake_cros_config_test") { |
| sources = [ |
| "libcros_config/fake_cros_config_test.cc", |
| ] |
| configs += [ |
| "//common-mk:test", |
| ":target_defaults", |
| ] |
| include_dirs = [ "libcros_config" ] |
| deps = [ |
| ":libcros_config", |
| ] |
| } |
| } |