Skip to content

Commit 21061c1

Browse files
committed
Vendor google's version of fmtlib
Fixes #44
1 parent 53df642 commit 21061c1

7 files changed

Lines changed: 15 additions & 10 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
run: |
1212
sudo apt-get update
1313
DEBIAN_FRONTEND=noninteractive sudo apt-get install -yq \
14-
${{ matrix.pkgs }} cmake git golang libbrotli-dev libfmt-dev \
14+
${{ matrix.pkgs }} cmake git golang libbrotli-dev \
1515
libgtest-dev liblz4-dev libpcre2-dev libprotobuf-dev libunwind-dev \
1616
libusb-1.0-0-dev libzstd-dev make pkg-config
1717
- name: checkout
@@ -71,31 +71,31 @@ jobs:
7171
run: |
7272
zypper -n ref
7373
zypper -n in ${{ matrix.pkgs }} cmake git go gtest pcre2-devel pkgconfig \
74-
'pkgconfig(fmt)' 'pkgconfig(libbrotlicommon)' 'pkgconfig(liblz4)' \
74+
'pkgconfig(libbrotlicommon)' 'pkgconfig(liblz4)' \
7575
'pkgconfig(libunwind-generic)' 'pkgconfig(libusb-1.0)' \
7676
'pkgconfig(libzstd)' 'pkgconfig(protobuf)' ninja
7777
7878
- name: prep archlinux
7979
if: startsWith(matrix.os, 'archlinux')
8080
run: |
8181
pacman -Syu --needed --noconfirm \
82-
${{ matrix.pkgs }} brotli cmake fmt git go gtest libunwind \
82+
${{ matrix.pkgs }} brotli cmake git go gtest libunwind \
8383
libusb lz4 pcre2 pkgconfig protobuf zstd ninja
8484
8585
- name: prep ubuntu
8686
if: startsWith(matrix.os, 'ubuntu')
8787
run: |
8888
apt-get update
8989
DEBIAN_FRONTEND=noninteractive apt-get install -yq \
90-
${{ matrix.pkgs }} cmake git golang libbrotli-dev libfmt-dev \
90+
${{ matrix.pkgs }} cmake git golang libbrotli-dev \
9191
libgtest-dev liblz4-dev libpcre2-dev libprotobuf-dev libunwind-dev \
9292
libusb-1.0-0-dev libzstd-dev pkg-config protobuf-compiler ninja-build
9393
9494
- name: prep alpine
9595
if: startsWith(matrix.os, 'alpine')
9696
run: |
9797
apk add build-base pcre2-dev linux-headers libusb-dev gtest-dev samurai \
98-
go git perl cmake protobuf-dev brotli-dev zstd-dev lz4-dev fmt-dev
98+
go git perl cmake protobuf-dev brotli-dev zstd-dev lz4-dev
9999
100100
# required for patches
101101
- name: git config

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,7 @@
5858
shallow = true
5959
path = vendor/incremental_delivery
6060
url = https://android.googlesource.com/platform/system/incremental_delivery
61+
[submodule "vendor/fmtlib"]
62+
shallow = true
63+
path = vendor/fmtlib
64+
url = https://android.googlesource.com/platform/external/fmtlib.git

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ The following libraries are required by android-tools:
4949
5. [brotli][brotli]
5050
6. [zstd][zstd]
5151
7. [lz4][lz4]
52-
8. [fmt][fmt]
5352

5453
Additionally the following software is required at compile-time:
5554

@@ -109,5 +108,4 @@ have been copied from Anatol's ruby script.
109108
[brotli]: https://github.com/google/brotli
110109
[zstd]: https://facebook.github.io/zstd/
111110
[lz4]: https://github.com/lz4/lz4
112-
[fmt]: https://github.com/fmtlib/fmt
113111
[anatol.pomozov]: https://github.com/anatol

vendor/CMakeLists.fastboot.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ target_include_directories(libfsmgr PRIVATE
4545
core/fs_mgr/liblp/include libbase/include
4646
extras/ext4_utils/include core/libsparse/include
4747
boringssl/include)
48+
target_link_libraries(libfsmgr PUBLIC fmt::fmt)
4849

4950
add_library(libselinux STATIC
5051
selinux/libselinux/src/booleans.c
@@ -134,4 +135,4 @@ target_compile_definitions(fastboot PRIVATE
134135
target_link_libraries(fastboot
135136
libsparse libzip libcutils liblog libfsmgr libutil
136137
libbase libext4 libselinux libsepol libdiagnoseusb crypto
137-
z pcre2-8 pthread dl fmt::fmt)
138+
z pcre2-8 pthread dl)

vendor/CMakeLists.libandroidfw.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ target_include_directories(libandroidfw PUBLIC
3434
native/include
3535
libziparchive/include
3636
incremental_delivery/incfs/util/include)
37+
target_link_libraries(libandroidfw PUBLIC fmt::fmt)

vendor/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ set(android-vendored
1515
f2fs-tools
1616
e2fsprogs
1717
incremental_delivery
18+
fmtlib
1819
boringssl)
1920

2021
if(EXISTS "${ANDROID_PATCH_DIR}/")
@@ -34,9 +35,8 @@ if(EXISTS "${ANDROID_PATCH_DIR}/")
3435
endif()
3536

3637
add_subdirectory(boringssl EXCLUDE_FROM_ALL)
38+
add_subdirectory(fmtlib EXCLUDE_FROM_ALL)
3739
find_package(Protobuf REQUIRED)
38-
find_package(fmt REQUIRED)
39-
include_directories(${fmt_INCLUDE_DIRS})
4040
include_directories(${PROTOBUF_INCLUDE_DIRS})
4141
include_directories(${CMAKE_CURRENT_BINARY_DIR})
4242

vendor/fmtlib

Submodule fmtlib added at fc21810

0 commit comments

Comments
 (0)