Dan Willemsen | c0a0f2d | 2017-09-09 13:37:03 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright 2008 The Android Open Source Project |
| 3 | // |
| 4 | // Zip alignment tool |
| 5 | // |
| 6 | |
Bob Badour | 0390580 | 2021-02-12 21:42:54 -0800 | [diff] [blame] | 7 | package { |
| 8 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 9 | } |
| 10 | |
Fabien Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 11 | cc_defaults { |
| 12 | name: "zipalign_defaults", |
| 13 | target: { |
| 14 | windows: { |
| 15 | host_ldlibs: ["-lpthread"], |
| 16 | enabled: true, |
| 17 | }, |
| 18 | }, |
| 19 | } |
Dan Willemsen | c0a0f2d | 2017-09-09 13:37:03 -0700 | [diff] [blame] | 20 | |
Fabien Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 21 | cc_library_host_static { |
| 22 | name: "libzipalign", |
Dan Willemsen | c0a0f2d | 2017-09-09 13:37:03 -0700 | [diff] [blame] | 23 | srcs: [ |
| 24 | "ZipAlign.cpp", |
| 25 | "ZipEntry.cpp", |
| 26 | "ZipFile.cpp", |
| 27 | ], |
Fabien Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 28 | export_include_dirs: [ |
| 29 | "include", |
| 30 | ], |
Chih-Hung Hsieh | 2a5bc9d | 2017-10-03 13:45:03 -0700 | [diff] [blame] | 31 | cflags: ["-Wall", "-Werror"], |
| 32 | |
Narayan Kamath | 887c645 | 2017-11-06 11:40:07 +0000 | [diff] [blame] | 33 | // NOTE: Do not add any shared_libs dependencies because they will break the |
| 34 | // static_sdk_tools target. |
Fabien Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 35 | whole_static_libs: [ |
Dan Willemsen | c0a0f2d | 2017-09-09 13:37:03 -0700 | [diff] [blame] | 36 | "libutils", |
| 37 | "libcutils", |
| 38 | "liblog", |
Narayan Kamath | 887c645 | 2017-11-06 11:40:07 +0000 | [diff] [blame] | 39 | "libziparchive", |
| 40 | "libz", |
| 41 | "libbase", |
Dan Willemsen | c0a0f2d | 2017-09-09 13:37:03 -0700 | [diff] [blame] | 42 | "libzopfli", |
Narayan Kamath | 0e4110e | 2017-10-26 18:00:13 +0100 | [diff] [blame] | 43 | ], |
Fabien Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 44 | defaults: ["zipalign_defaults"], |
| 45 | } |
Narayan Kamath | 0e4110e | 2017-10-26 18:00:13 +0100 | [diff] [blame] | 46 | |
Fabien Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 47 | cc_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 | |
| 59 | cc_test_host { |
| 60 | name: "zipalign_tests", |
| 61 | srcs: [ |
| 62 | "tests/src/*_test.cpp", |
| 63 | ], |
Julien Desprez | 74b8e09 | 2020-12-11 11:52:45 -0800 | [diff] [blame] | 64 | test_options: { |
| 65 | unit_test: true, |
| 66 | }, |
Fabien Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 67 | static_libs: [ |
Fabien Sanglard | 6dfc6fb | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 68 | "libbase", |
Fabien Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 69 | "libzipalign", |
| 70 | "libgmock", |
| 71 | ], |
| 72 | data: [ |
Fabien Sanglard | a720635 | 2020-10-20 15:47:10 -0700 | [diff] [blame] | 73 | "tests/data/diffOrders.zip", |
| 74 | "tests/data/holes.zip", |
Fabien Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 75 | "tests/data/unaligned.zip", |
| 76 | ], |
| 77 | defaults: ["zipalign_defaults"], |
Elliott Hughes | c203915 | 2020-11-05 14:58:12 -0800 | [diff] [blame] | 78 | test_suites: ["general-tests"], |
Dan Willemsen | c0a0f2d | 2017-09-09 13:37:03 -0700 | [diff] [blame] | 79 | } |