Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add zipalign #167

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@
shallow = true
path = vendor/libusb
url = https://android.googlesource.com/platform/external/libusb.git
[submodule "vendor/build"]
shallow = true
path = vendor/build
url = https://android.googlesource.com/platform/build.git
15 changes: 0 additions & 15 deletions vendor/CMakeLists.fastboot.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
add_library(libzip STATIC
libziparchive/zip_archive.cc
libziparchive/zip_archive_stream_entry.cc
libziparchive/zip_cd_entry_map.cc
libziparchive/zip_error.cpp
libziparchive/zip_writer.cc)

target_compile_definitions(libzip PRIVATE -DZLIB_CONST)
target_include_directories(libzip PUBLIC
libziparchive/include
libziparchive/incfs_support/include
core/include
logging/liblog/include
libbase/include)

add_library(libutil STATIC
core/libutils/FileMap.cpp
core/libutils/JenkinsHash.cpp
Expand Down
29 changes: 29 additions & 0 deletions vendor/CMakeLists.libutils.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
add_library(libutils STATIC
# core/libutils/CallStack.cpp
# core/libutils/FileMap.cpp
# core/libutils/JenkinsHash.cpp
# core/libutils/LightRefBase.cpp
# core/libutils/Looper.cpp
# core/libutils/NativeHandle.cpp
# core/libutils/Printer.cpp
# core/libutils/ProcessCallStack.cpp
# core/libutils/StopWatch.cpp
# core/libutils/SystemClock.cpp
# core/libutils/Threads.cpp
# core/libutils/Timers.cpp
# core/libutils/Tokenizer.cpp
# core/libutils/Trace.cpp
core/libutils/binder/Errors.cpp
# core/libutils/binder/RefBase.cpp
# core/libutils/binder/SharedBuffer.cpp
# core/libutils/binder/String16.cpp
# core/libutils/binder/String8.cpp
# core/libutils/binder/StrongPointer.cpp
# core/libutils/binder/Unicode.cpp
# core/libutils/binder/VectorImpl.cpp
# core/libutils/misc.cpp
)

target_include_directories(libutils PUBLIC
core/libutils/include)
target_link_libraries(libutils PUBLIC liblog)
14 changes: 14 additions & 0 deletions vendor/CMakeLists.libziparchive.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
add_library(libzip STATIC
libziparchive/zip_archive.cc
libziparchive/zip_archive_stream_entry.cc
libziparchive/zip_cd_entry_map.cc
libziparchive/zip_error.cpp
libziparchive/zip_writer.cc)

target_compile_definitions(libzip PRIVATE -DZLIB_CONST)
target_include_directories(libzip PUBLIC
libziparchive/include
libziparchive/incfs_support/include
core/include
logging/liblog/include
libbase/include)
4 changes: 4 additions & 0 deletions vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,16 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
include(CMakeLists.libbase.txt)
include(CMakeLists.adb.txt)
include(CMakeLists.sparse.txt)
include(CMakeLists.libziparchive.txt)
include(CMakeLists.fastboot.txt)
include(CMakeLists.f2fstools.txt)
include(CMakeLists.mke2fs.txt)
include(CMakeLists.partition.txt)
include(CMakeLists.mkbootimg.txt)
include(CMakeLists.libufdt.txt)
include(CMakeLists.avb.txt)
include(CMakeLists.libutils.txt)
include(CMakeLists.zipalign.txt)

# Targets which should be installed by `make install`.
install(TARGETS
Expand All @@ -137,6 +140,7 @@ install(TARGETS
sload_f2fs
simg2img
ext2simg
zipalign
DESTINATION bin)

if(NOT APPLE)
Expand Down
14 changes: 14 additions & 0 deletions vendor/CMakeLists.zipalign.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
find_package(Zopfli REQUIRED)

add_executable(zipalign
build/tools/zipalign/include/ZipAlign.h
build/tools/zipalign/ZipAlign.cpp
build/tools/zipalign/ZipAlignMain.cpp
build/tools/zipalign/ZipEntry.cpp
build/tools/zipalign/ZipEntry.h
build/tools/zipalign/ZipFile.cpp
build/tools/zipalign/ZipFile.h)

target_include_directories(zipalign PRIVATE
build/tools/zipalign/include)
target_link_libraries(zipalign PRIVATE libutils libzip zopfli)
1 change: 1 addition & 0 deletions vendor/build
Submodule build added at 00338e