blob: 8cab04cd13f796124750f9012aa793cf6d72126d [file] [log] [blame]
Dan Willemsenc0a0f2d2017-09-09 13:37:03 -07001//
2// Copyright 2008 The Android Open Source Project
3//
4// Zip alignment tool
5//
6
Bob Badour03905802021-02-12 21:42:54 -08007package {
8 default_applicable_licenses: ["Android-Apache-2.0"],
9}
10
Fabien Sanglard0f29f542020-10-22 17:58:12 -070011cc_defaults {
12 name: "zipalign_defaults",
13 target: {
14 windows: {
15 host_ldlibs: ["-lpthread"],
16 enabled: true,
17 },
18 },
19}
Dan Willemsenc0a0f2d2017-09-09 13:37:03 -070020
Fabien Sanglard0f29f542020-10-22 17:58:12 -070021cc_library_host_static {
22 name: "libzipalign",
Dan Willemsenc0a0f2d2017-09-09 13:37:03 -070023 srcs: [
24 "ZipAlign.cpp",
25 "ZipEntry.cpp",
26 "ZipFile.cpp",
27 ],
Fabien Sanglard0f29f542020-10-22 17:58:12 -070028 export_include_dirs: [
29 "include",
30 ],
Chih-Hung Hsieh2a5bc9d2017-10-03 13:45:03 -070031 cflags: ["-Wall", "-Werror"],
32
Narayan Kamath887c6452017-11-06 11:40:07 +000033 // NOTE: Do not add any shared_libs dependencies because they will break the
34 // static_sdk_tools target.
Fabien Sanglard0f29f542020-10-22 17:58:12 -070035 whole_static_libs: [
Dan Willemsenc0a0f2d2017-09-09 13:37:03 -070036 "libutils",
37 "libcutils",
38 "liblog",
Narayan Kamath887c6452017-11-06 11:40:07 +000039 "libziparchive",
40 "libz",
41 "libbase",
Dan Willemsenc0a0f2d2017-09-09 13:37:03 -070042 "libzopfli",
Narayan Kamath0e4110e2017-10-26 18:00:13 +010043 ],
Fabien Sanglard0f29f542020-10-22 17:58:12 -070044 defaults: ["zipalign_defaults"],
45}
Narayan Kamath0e4110e2017-10-26 18:00:13 +010046
Fabien Sanglard0f29f542020-10-22 17:58:12 -070047cc_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 ],
Julien Desprez74b8e092020-12-11 11:52:45 -080064 test_options: {
65 unit_test: true,
66 },
Fabien Sanglard0f29f542020-10-22 17:58:12 -070067 static_libs: [
Fabien Sanglard6dfc6fb2020-10-22 17:58:12 -070068 "libbase",
Fabien Sanglard0f29f542020-10-22 17:58:12 -070069 "libzipalign",
70 "libgmock",
71 ],
72 data: [
Fabien Sanglarda7206352020-10-20 15:47:10 -070073 "tests/data/diffOrders.zip",
74 "tests/data/holes.zip",
Fabien Sanglard0f29f542020-10-22 17:58:12 -070075 "tests/data/unaligned.zip",
76 ],
77 defaults: ["zipalign_defaults"],
Elliott Hughesc2039152020-11-05 14:58:12 -080078 test_suites: ["general-tests"],
Dan Willemsenc0a0f2d2017-09-09 13:37:03 -070079}