| # Copyright 2020 The Fuchsia 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("//build/cpp/sdk_source_set.gni") |
| |
| common_vars = { |
| sources = [ |
| "libavb/avb_chain_partition_descriptor.c", |
| "libavb/avb_chain_partition_descriptor.h", |
| "libavb/avb_cmdline.c", |
| "libavb/avb_cmdline.h", |
| "libavb/avb_crc32.c", |
| "libavb/avb_crypto.c", |
| "libavb/avb_crypto.h", |
| "libavb/avb_descriptor.c", |
| "libavb/avb_descriptor.h", |
| "libavb/avb_footer.c", |
| "libavb/avb_footer.h", |
| "libavb/avb_hash_descriptor.c", |
| "libavb/avb_hash_descriptor.h", |
| "libavb/avb_hashtree_descriptor.c", |
| "libavb/avb_hashtree_descriptor.h", |
| "libavb/avb_kernel_cmdline_descriptor.c", |
| "libavb/avb_kernel_cmdline_descriptor.h", |
| "libavb/avb_ops.h", |
| "libavb/avb_property_descriptor.c", |
| "libavb/avb_property_descriptor.h", |
| "libavb/avb_rsa.c", |
| "libavb/avb_rsa.h", |
| "libavb/avb_sha.h", |
| "libavb/avb_sha256.c", |
| "libavb/avb_sha512.c", |
| "libavb/avb_slot_verify.c", |
| "libavb/avb_slot_verify.h", |
| "libavb/avb_sysdeps.h", |
| "libavb/avb_util.c", |
| "libavb/avb_util.h", |
| "libavb/avb_vbmeta_image.c", |
| "libavb/avb_vbmeta_image.h", |
| "libavb/avb_version.c", |
| "libavb/avb_version.h", |
| "libavb/libavb.h", |
| "libavb_atx/avb_atx_ops.h", |
| "libavb_atx/avb_atx_types.h", |
| "libavb_atx/avb_atx_validate.c", |
| "libavb_atx/avb_atx_validate.h", |
| "libavb_atx/libavb_atx.h", |
| ] |
| |
| cflags_c = [ |
| "-DAVB_COMPILATION", |
| "-Wno-implicit-int-conversion", |
| "-Wno-shorten-64-to-32", |
| "-Wno-strict-prototypes", |
| ] |
| |
| public = [ |
| "include/libavb/avb_rsa.h", |
| "include/libavb/avb_sha.h", |
| "include/libavb/avb_sysdeps.h", |
| "include/libavb/avb_util.h", |
| "include/libavb/libavb.h", |
| "include/libavb_atx/libavb_atx.h", |
| ] |
| |
| public_configs = [ ":public_include_dirs" ] |
| } |
| |
| # SDK library. |
| sdk_source_set("avb") { |
| category = "experimental" |
| sdk_name = "avb" |
| |
| forward_variables_from(common_vars, "*") |
| |
| # For publishable avb sdk target, add the posix implementation as a reference |
| sources += [ "libavb/avb_sysdeps_posix.c" ] |
| } |
| |
| # A target for posix implementation for avb sysdeps. |
| source_set("sysdeps-posix") { |
| sources = [ "libavb/avb_sysdeps_posix.c" ] |
| cflags_c = [ "-DAVB_COMPILATION" ] |
| } |
| |
| # A library target for in-tree use. Sysdeps implementation is not given and |
| # need to be provided by the final executable target or the toolchain. |
| source_set("lib") { |
| forward_variables_from(common_vars, "*") |
| public += [ "libavb/avb_sysdeps.h" ] |
| |
| if (is_kernel) { |
| public_deps = [ "//zircon/kernel/lib/libc" ] |
| } |
| } |
| |
| config("public_include_dirs") { |
| include_dirs = [ "include" ] |
| } |