Skip to content

Commit

Permalink
CMake: Add option to use system fmt library
Browse files Browse the repository at this point in the history
fmt library was added in vendor in 21061c1 commit
for systems with older fmt versions. Now, distributions can choose to link with
their own fmt shared library or use the bundled one.
  • Loading branch information
Biswa96 committed Aug 9, 2024
1 parent 44c9dc3 commit 611ffb9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ include(GNUInstallDirs)
# This helps to build vendor projects with or without any patching. Also if any
# files are changed in vendor projects those can be retained with this option.
option(ANDROID_TOOLS_PATCH_VENDOR "Patch vendor projects using patches directory" ON)
option(ANDROID_TOOLS_USE_SYSTEM_FMT "Use system provided fmt library instead of bundled one" OFF)

# Install bash/zsh completion files.
set(COMPLETION_COMMON_DIR "${CMAKE_INSTALL_FULL_DATADIR}/android-tools/completions")
Expand Down
8 changes: 7 additions & 1 deletion vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ if(ANDROID_TOOLS_PATCH_VENDOR AND EXISTS "${ANDROID_PATCH_DIR}/")
endif()

add_subdirectory(boringssl EXCLUDE_FROM_ALL)
add_subdirectory(fmtlib EXCLUDE_FROM_ALL)

if(ANDROID_TOOLS_USE_SYSTEM_FMT)
find_package(fmt CONFIG REQUIRED)
message(STATUS "Found fmt: ${fmt_DIR} (version ${fmt_VERSION})")
else()
add_subdirectory(fmtlib EXCLUDE_FROM_ALL)
endif()

find_package(PkgConfig REQUIRED)
pkg_check_modules(libbrotlicommon REQUIRED IMPORTED_TARGET libbrotlicommon)
Expand Down

0 comments on commit 611ffb9

Please sign in to comment.