Skip to content

Commit

Permalink
add zipalign
Browse files Browse the repository at this point in the history
  • Loading branch information
selfisekai committed Nov 26, 2024
1 parent 21b50b6 commit f30b03b
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 15 deletions.
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

0 comments on commit f30b03b

Please sign in to comment.