blob: ab04d1dd4f5e03c318d23d36abe5733cd96d30ac [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
Fabien Sanglard0f29f542020-10-22 17:58:12 -07007cc_defaults {
8 name: "zipalign_defaults",
9 target: {
10 windows: {
11 host_ldlibs: ["-lpthread"],
12 enabled: true,
13 },
14 },
15}
Dan Willemsenc0a0f2d2017-09-09 13:37:03 -070016
Fabien Sanglard0f29f542020-10-22 17:58:12 -070017cc_library_host_static {
18 name: "libzipalign",
Dan Willemsenc0a0f2d2017-09-09 13:37:03 -070019 srcs: [
20 "ZipAlign.cpp",
21 "ZipEntry.cpp",
22 "ZipFile.cpp",
23 ],
Fabien Sanglard0f29f542020-10-22 17:58:12 -070024 export_include_dirs: [
25 "include",
26 ],
Chih-Hung Hsieh2a5bc9d2017-10-03 13:45:03 -070027 cflags: ["-Wall", "-Werror"],
28
Narayan Kamath887c6452017-11-06 11:40:07 +000029 // NOTE: Do not add any shared_libs dependencies because they will break the
30 // static_sdk_tools target.
Fabien Sanglard0f29f542020-10-22 17:58:12 -070031 whole_static_libs: [
Dan Willemsenc0a0f2d2017-09-09 13:37:03 -070032 "libutils",
33 "libcutils",
34 "liblog",
Narayan Kamath887c6452017-11-06 11:40:07 +000035 "libziparchive",
36 "libz",
37 "libbase",
Dan Willemsenc0a0f2d2017-09-09 13:37:03 -070038 "libzopfli",
Narayan Kamath0e4110e2017-10-26 18:00:13 +010039 ],
Fabien Sanglard0f29f542020-10-22 17:58:12 -070040 defaults: ["zipalign_defaults"],
41}
Narayan Kamath0e4110e2017-10-26 18:00:13 +010042
Fabien Sanglard0f29f542020-10-22 17:58:12 -070043cc_binary_host {
44 name: "zipalign",
45 srcs: [
46 "ZipAlignMain.cpp",
47 ],
48 cflags: ["-Wall", "-Werror"],
49 static_libs: [
50 "libzipalign",
51 ],
52 defaults: ["zipalign_defaults"],
53}
54
55cc_test_host {
56 name: "zipalign_tests",
57 srcs: [
58 "tests/src/*_test.cpp",
59 ],
60 static_libs: [
61 "libzipalign",
62 "libgmock",
63 ],
64 data: [
65 "tests/data/unaligned.zip",
66 ],
67 defaults: ["zipalign_defaults"],
Elliott Hughesc2039152020-11-05 14:58:12 -080068 test_suites: ["general-tests"],
Dan Willemsenc0a0f2d2017-09-09 13:37:03 -070069}