1// Copyright 2015 The Android Open Source Project
2
3cc_defaults {
4    name: "libfec_default",
5
6    cflags: [
7        "-Wall",
8        "-Werror",
9        "-O3",
10        "-D_LARGEFILE64_SOURCE",
11    ],
12
13    srcs: [
14        "fec_open.cpp",
15        "fec_read.cpp",
16        "fec_verity.cpp",
17        "fec_process.cpp",
18    ],
19
20    export_include_dirs: ["include"],
21    // Exported header include/fec/io.h includes crypto_utils headers.
22    export_shared_lib_headers: ["libcrypto_utils"],
23
24    shared_libs: [
25        "libbase",
26        "libcrypto",
27        "libcrypto_utils",
28        "libcutils",
29        "libext4_utils",
30        "libsquashfs_utils",
31    ],
32
33    static_libs: [
34        "libfec_rs",
35    ],
36
37    target: {
38        host: {
39            cflags: [
40                "-D_GNU_SOURCE",
41                "-DFEC_NO_KLOG",
42            ],
43        },
44        linux_glibc: {
45            sanitize: {
46                misc_undefined: ["integer"],
47            },
48        },
49    },
50}
51
52cc_library {
53    name: "libfec",
54    defaults: ["libfec_default"],
55    host_supported: true,
56    recovery_available: true,
57
58    target: {
59        linux: {
60            srcs: [
61                "avb_utils.cpp",
62            ],
63            static_libs: [
64                "libavb",
65            ],
66        },
67
68        // libavb isn't available on mac.
69        darwin: {
70            srcs: [
71                "avb_utils_stub.cpp",
72            ],
73        },
74    },
75}
76