| # Copyright 2023 The ChromiumOS Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//common-mk/deps.gni") |
| import("//common-mk/pkg_config.gni") |
| |
| group("all") { |
| deps = [ |
| ":install_libsegmentation_headers", |
| ":libsegmentation", |
| ":libsegmentation-test", |
| ":libsegmentation-test_pc", |
| ":libsegmentation_pc", |
| ":libsegmentation_static", |
| ] |
| if (use.test) { |
| deps += [ ":libsegmentation_tests" ] |
| } |
| } |
| |
| default_pkg_deps = [ |
| "libbrillo", |
| "libchrome", |
| ] |
| pkg_config("target_defaults_pkg_deps") { |
| pkg_deps = default_pkg_deps |
| } |
| |
| libsegmentation_sources = [ |
| "feature_management.cc", |
| "feature_management_impl.cc", |
| ] |
| |
| static_library("libsegmentation_static") { |
| sources = libsegmentation_sources |
| configs += [ ":target_defaults_pkg_deps" ] |
| install_path = "lib" |
| } |
| |
| shared_library("libsegmentation") { |
| sources = libsegmentation_sources |
| configs += [ ":target_defaults_pkg_deps" ] |
| install_path = "lib" |
| } |
| |
| install_config("install_libsegmentation_headers") { |
| sources = [ "feature_management.h" ] |
| install_path = "/usr/include/libsegmentation" |
| } |
| |
| generate_pkg_config("libsegmentation-test_pc") { |
| name = "libsegmentation-test" |
| output_name = "libsegmentation-test" |
| description = "libsegmentation test library" |
| version = "0.1" |
| |
| requires = [] |
| requires_private = [ "libsegmentation" ] + default_pkg_deps |
| libs = [ "-lsegmentation-test" ] |
| install = true |
| } |
| |
| shared_library("libsegmentation-test") { |
| sources = [ "feature_management_fake.cc" ] |
| configs += [ ":target_defaults_pkg_deps" ] |
| deps = [ ":libsegmentation-test_pc" ] |
| install_path = "lib" |
| } |
| |
| generate_pkg_config("libsegmentation_pc") { |
| name = "libsegmentation" |
| output_name = "libsegmentation" |
| description = "Library to get Chromium OS system properties" |
| version = "0.1" |
| |
| requires = [] |
| requires_private = default_pkg_deps |
| libs = [ "-lsegmentation" ] |
| install = true |
| } |
| |
| if (use.test) { |
| executable("libsegmentation_tests") { |
| sources = [ "feature_management_test.cc" ] |
| configs += [ |
| "//common-mk:test", |
| ":target_defaults_pkg_deps", |
| ] |
| run_test = true |
| deps = [ |
| ":libsegmentation-test", |
| ":libsegmentation_static", |
| "//common-mk/testrunner", |
| ] |
| } |
| } |