| # Copyright 2020 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/pkg_config.gni") |
| |
| group("all") { |
| deps = [ |
| ":install_fls_header", |
| ":install_headers", |
| ":install_pkg_config", |
| ":libdm-bht", |
| ":verity", |
| ] |
| if (use.test) { |
| deps += [ ":verity_tests" ] |
| } |
| } |
| |
| pkg_config("target_defaults") { |
| pkg_deps = [ |
| "libbrillo", |
| "libchrome", |
| ] |
| include_dirs = [ "include" ] |
| } |
| |
| shared_library("libdm-bht") { |
| sources = [ |
| "dm-bht.cc", |
| "file_hasher.cc", |
| ] |
| install_path = "lib" |
| configs += [ ":target_defaults" ] |
| } |
| |
| executable("verity") { |
| sources = [ "verity_main.cc" ] |
| configs += [ ":target_defaults" ] |
| install_path = "bin" |
| deps = [ ":libdm-bht" ] |
| } |
| |
| install_config("install_pkg_config") { |
| sources = [ "libdm-bht.pc" ] |
| install_path = "${libdir}/pkgconfig" |
| } |
| |
| install_config("install_headers") { |
| sources = [ |
| "dm-bht-userspace.h", |
| "dm-bht.h", |
| "file_hasher.h", |
| ] |
| install_path = "/usr/include/verity" |
| } |
| |
| install_config("install_fls_header") { |
| sources = [ "include/asm-generic/bitops/fls.h" ] |
| install_path = "/usr/include/verity/asm-generic/bitops/" |
| } |
| |
| if (use.test) { |
| executable("verity_tests") { |
| sources = [ |
| "dm-bht_test.cc", |
| "file_hasher_test.cc", |
| ] |
| configs += [ |
| "//common-mk:test", |
| ":target_defaults", |
| ] |
| deps = [ |
| ":libdm-bht", |
| "//common-mk/testrunner", |
| ] |
| run_test = true |
| } |
| } |