1//
2// Copyright 2008 The Android Open Source Project
3//
4// Zip alignment tool
5//
6
7package {
8    default_applicable_licenses: ["Android-Apache-2.0"],
9}
10
11cc_defaults {
12    name: "zipalign_defaults",
13    target: {
14        windows: {
15            host_ldlibs: ["-lpthread"],
16            enabled: true,
17        },
18    },
19}
20
21cc_library_host_static {
22    name: "libzipalign",
23    srcs: [
24        "ZipAlign.cpp",
25        "ZipEntry.cpp",
26        "ZipFile.cpp",
27    ],
28    export_include_dirs: [
29        "include",
30    ],
31    cflags: ["-Wall", "-Werror"],
32
33    // NOTE: Do not add any shared_libs dependencies because they will break the
34    // static_sdk_tools target.
35    whole_static_libs: [
36        "libutils",
37        "libcutils",
38        "liblog",
39        "libziparchive",
40        "libz",
41        "libbase",
42        "libzopfli",
43    ],
44    defaults: ["zipalign_defaults"],
45}
46
47cc_binary_host {
48    name: "zipalign",
49    srcs: [
50        "ZipAlignMain.cpp",
51    ],
52    cflags: ["-Wall", "-Werror"],
53    static_libs: [
54        "libzipalign",
55    ],
56    defaults: ["zipalign_defaults"],
57}
58
59cc_test_host {
60    name: "zipalign_tests",
61    srcs: [
62        "tests/src/*_test.cpp",
63    ],
64    test_options: {
65        unit_test: true,
66    },
67    static_libs: [
68        "libbase",
69        "libzipalign",
70        "libgmock",
71    ],
72    data: [
73         "tests/data/diffOrders.zip",
74         "tests/data/holes.zip",
75         "tests/data/unaligned.zip",
76    ],
77    defaults: ["zipalign_defaults"],
78    test_suites: ["general-tests"],
79}
80