55405b61be
Allow apps to specify the target page size for aligning their uncompressed shared libraries. This allows apps that want to support larger page sizes to do so by specifiying the -P <pagesize_kb> flag. However, apps built for 4k-only devices are unaffected as they can continue to use -p flag for 4kB page alignment of uncompressed shared libraries. Bug: 276963821 Test: atest -c zipalign_tests Change-Id: I890db067b8f898045f73e86788662f94a48af772 Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
81 lines
1.6 KiB
Text
81 lines
1.6 KiB
Text
//
|
|
// Copyright 2008 The Android Open Source Project
|
|
//
|
|
// Zip alignment tool
|
|
//
|
|
|
|
package {
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
|
}
|
|
|
|
cc_defaults {
|
|
name: "zipalign_defaults",
|
|
target: {
|
|
windows: {
|
|
host_ldlibs: ["-lpthread"],
|
|
enabled: true,
|
|
},
|
|
},
|
|
}
|
|
|
|
cc_library_host_static {
|
|
name: "libzipalign",
|
|
srcs: [
|
|
"ZipAlign.cpp",
|
|
"ZipEntry.cpp",
|
|
"ZipFile.cpp",
|
|
],
|
|
export_include_dirs: [
|
|
"include",
|
|
],
|
|
cflags: ["-Wall", "-Werror"],
|
|
|
|
// NOTE: Do not add any shared_libs dependencies because they will break the
|
|
// static_sdk_tools target.
|
|
whole_static_libs: [
|
|
"libutils",
|
|
"libcutils",
|
|
"liblog",
|
|
"libziparchive",
|
|
"libz",
|
|
"libbase",
|
|
"libzopfli",
|
|
],
|
|
defaults: ["zipalign_defaults"],
|
|
}
|
|
|
|
cc_binary_host {
|
|
name: "zipalign",
|
|
srcs: [
|
|
"ZipAlignMain.cpp",
|
|
],
|
|
cflags: ["-Wall", "-Werror"],
|
|
static_libs: [
|
|
"libzipalign",
|
|
],
|
|
defaults: ["zipalign_defaults"],
|
|
}
|
|
|
|
cc_test_host {
|
|
name: "zipalign_tests",
|
|
srcs: [
|
|
"tests/src/*_test.cpp",
|
|
],
|
|
test_options: {
|
|
unit_test: true,
|
|
},
|
|
static_libs: [
|
|
"libbase",
|
|
"libzipalign",
|
|
"libgmock",
|
|
],
|
|
data: [
|
|
"tests/data/apkWithUncompressedSharedLibs.zip",
|
|
"tests/data/archiveWithOneDirectoryEntry.zip",
|
|
"tests/data/diffOrders.zip",
|
|
"tests/data/holes.zip",
|
|
"tests/data/unaligned.zip",
|
|
],
|
|
defaults: ["zipalign_defaults"],
|
|
test_suites: ["general-tests"],
|
|
}
|