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 | |
Fabien Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 7 | cc_defaults { |
| 8 | name: "zipalign_defaults", |
| 9 | target: { |
| 10 | windows: { |
| 11 | host_ldlibs: ["-lpthread"], |
| 12 | enabled: true, |
| 13 | }, |
| 14 | }, |
| 15 | } |
Dan Willemsen | c0a0f2d | 2017-09-09 13:37:03 -0700 | [diff] [blame] | 16 | |
Fabien Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 17 | cc_library_host_static { |
| 18 | name: "libzipalign", |
Dan Willemsen | c0a0f2d | 2017-09-09 13:37:03 -0700 | [diff] [blame] | 19 | srcs: [ |
| 20 | "ZipAlign.cpp", |
| 21 | "ZipEntry.cpp", |
| 22 | "ZipFile.cpp", |
| 23 | ], |
Fabien Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 24 | export_include_dirs: [ |
| 25 | "include", |
| 26 | ], |
Chih-Hung Hsieh | 2a5bc9d | 2017-10-03 13:45:03 -0700 | [diff] [blame] | 27 | cflags: ["-Wall", "-Werror"], |
| 28 | |
Narayan Kamath | 887c645 | 2017-11-06 11:40:07 +0000 | [diff] [blame] | 29 | // NOTE: Do not add any shared_libs dependencies because they will break the |
| 30 | // static_sdk_tools target. |
Fabien Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 31 | whole_static_libs: [ |
Dan Willemsen | c0a0f2d | 2017-09-09 13:37:03 -0700 | [diff] [blame] | 32 | "libutils", |
| 33 | "libcutils", |
| 34 | "liblog", |
Narayan Kamath | 887c645 | 2017-11-06 11:40:07 +0000 | [diff] [blame] | 35 | "libziparchive", |
| 36 | "libz", |
| 37 | "libbase", |
Dan Willemsen | c0a0f2d | 2017-09-09 13:37:03 -0700 | [diff] [blame] | 38 | "libzopfli", |
Narayan Kamath | 0e4110e | 2017-10-26 18:00:13 +0100 | [diff] [blame] | 39 | ], |
Fabien Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 40 | defaults: ["zipalign_defaults"], |
| 41 | } |
Narayan Kamath | 0e4110e | 2017-10-26 18:00:13 +0100 | [diff] [blame] | 42 | |
Fabien Sanglard | 0f29f54 | 2020-10-22 17:58:12 -0700 | [diff] [blame] | 43 | cc_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 | |
| 55 | cc_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 Hughes | c203915 | 2020-11-05 14:58:12 -0800 | [diff] [blame^] | 68 | test_suites: ["general-tests"], |
Dan Willemsen | c0a0f2d | 2017-09-09 13:37:03 -0700 | [diff] [blame] | 69 | } |