Skip to content

Commit

Permalink
[3rd-party/vcpkg] move "fmt" from submodules to vcpkg
Browse files Browse the repository at this point in the history
removed "fmt" submodule, and added fmt/11.0.2 as vcpkg dependency.

added a find_package() call for fmt.

replaced all "fmt" CMakeLists references with fmt::fmt-header-only

Signed-off-by: Mustafa Kemal Gilor <[email protected]>
  • Loading branch information
xmkg committed Feb 28, 2025
1 parent cd4f45a commit fcfd598
Show file tree
Hide file tree
Showing 25 changed files with 38 additions and 36 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
[submodule "3rd-party/scope_guard"]
path = 3rd-party/scope_guard
url = https://github.com/ricab/scope_guard.git
[submodule "3rd-party/fmt"]
path = 3rd-party/fmt
url = https://github.com/fmtlib/fmt.git
[submodule "3rd-party/vcpkg"]
path = 3rd-party/vcpkg
url = https://github.com/microsoft/vcpkg
Expand Down
6 changes: 0 additions & 6 deletions 3rd-party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ target_link_libraries(yaml INTERFACE
# libssh config
add_subdirectory(libssh)

# fmt header only library
add_library(fmt INTERFACE)
target_compile_definitions(fmt INTERFACE FMT_HEADER_ONLY=1)
target_include_directories(fmt INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/fmt/include)

# premock header only library to mock c-functions
add_library(premock INTERFACE)
target_include_directories(premock INTERFACE
Expand Down
1 change: 0 additions & 1 deletion 3rd-party/fmt
Submodule fmt deleted from 0c9fce
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ find_package(OpenSSL REQUIRED)
# gRPC config
find_package(gRPC CONFIG REQUIRED)

# fmt config
find_package(fmt CONFIG REQUIRED)
# targets: fmt::fmt, fmt::fmt-header-only

# Needs to be here before we set further compilation options
add_subdirectory(3rd-party)

Expand Down
2 changes: 1 addition & 1 deletion src/cert/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ target_compile_options(cert PRIVATE
)

target_link_libraries(cert
fmt
fmt::fmt-header-only
utils
OpenSSL::SSL
OpenSSL::Crypto
Expand Down
2 changes: 1 addition & 1 deletion src/client/cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ add_library(client STATIC
target_link_libraries(client
client_platform
commands
fmt
fmt::fmt-header-only
formatter
rpc
scope_guard
Expand Down
2 changes: 1 addition & 1 deletion src/client/cli/formatter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ add_library(formatter STATIC

target_link_libraries(formatter
client_common
fmt
fmt::fmt-header-only
rpc
settings
utils
Expand Down
2 changes: 1 addition & 1 deletion src/client/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ add_library(client_common STATIC

target_link_libraries(client_common
cert
fmt
fmt::fmt-header-only
platform
rpc
settings
Expand Down
6 changes: 3 additions & 3 deletions src/daemon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ include_directories(daemon
target_link_libraries(daemon
cert
delayed_shutdown
fmt
fmt::fmt-header-only
logger
petname
platform
Expand All @@ -55,7 +55,7 @@ add_library(delayed_shutdown STATIC
${CMAKE_SOURCE_DIR}/include/multipass/delayed_shutdown_timer.h)

target_link_libraries(delayed_shutdown
fmt
fmt::fmt-header-only
logger
ssh_common
Qt6::Core
Expand All @@ -64,7 +64,7 @@ target_link_libraries(delayed_shutdown
add_executable(multipassd daemon_main.cpp)

target_link_libraries(multipassd
fmt
fmt::fmt-header-only
daemon)

install(TARGETS multipassd
Expand Down
2 changes: 1 addition & 1 deletion src/iso/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ add_library(iso STATIC
cloud_init_iso.cpp)

target_link_libraries(iso
fmt
fmt::fmt-header-only
utils
Qt6::Core)
2 changes: 1 addition & 1 deletion src/logging/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ add_library(logger STATIC
standard_logger.cpp)

target_link_libraries(logger
fmt
fmt::fmt-header-only
Qt6::Core)
2 changes: 1 addition & 1 deletion src/network/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ add_library(ip_address STATIC
ip_address.cpp)

target_link_libraries(network
fmt
fmt::fmt-header-only
logger
utils
Qt6::Core
Expand Down
2 changes: 1 addition & 1 deletion src/platform/backends/libvirt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function(add_libvirt_target TARGET_NAME)
target_include_directories(${TARGET_NAME} PRIVATE ${LIBVIRT_INCLUDE_DIRS})
target_link_libraries(${TARGET_NAME}
daemon
fmt
fmt::fmt-header-only
ip_address
qemu_img_utils
Qt6::Core
Expand Down
2 changes: 1 addition & 1 deletion src/platform/backends/lxd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ add_library(lxd_backend STATIC
target_link_libraries(lxd_backend
Qt6::Core
Qt6::Network
fmt
fmt::fmt-header-only
ip_address
logger
network
Expand Down
2 changes: 1 addition & 1 deletion src/platform/backends/qemu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ add_library(qemu_backend STATIC
${CMAKE_SOURCE_DIR}/include/multipass/process/process.h)

target_link_libraries(qemu_backend
fmt
fmt::fmt-header-only
ip_address
logger
qemu_img_utils
Expand Down
2 changes: 1 addition & 1 deletion src/platform/backends/shared/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function(add_target TARGET_NAME)

target_link_libraries(${TARGET_NAME}
apparmor
fmt
fmt::fmt-header-only
scope_guard
shared
utils
Expand Down
2 changes: 1 addition & 1 deletion src/platform/backends/shared/qemu_img_utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ add_library(qemu_img_utils STATIC EXCLUDE_FROM_ALL
qemu_img_utils.cpp)

target_link_libraries(qemu_img_utils
fmt
fmt::fmt-header-only
Qt6::Core)
4 changes: 2 additions & 2 deletions src/platform/logger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ if (NOT MULTIPASS_ENABLE_SYSLOG)
add_library(logger_linux STATIC linux_logger.cpp journald_logger.cpp)
target_include_directories(logger_linux PRIVATE
${JOURNALD_INCLUDE_DIRS})
target_link_libraries(logger_linux fmt Qt6::Core ${JOURNALD_LIBRARIES})
target_link_libraries(logger_linux fmt::fmt-header-only Qt6::Core ${JOURNALD_LIBRARIES})
endif()
endif()

if (MULTIPASS_ENABLE_SYSLOG OR NOT JOURNALD_FOUND)
check_include_files(syslog.h HAVE_SYSLOG_H)
check_function_exists(syslog HAVE_SYSLOG)
add_library(logger_linux STATIC linux_logger.cpp syslog_logger.cpp)
target_link_libraries(logger_linux fmt Qt6::Core)
target_link_libraries(logger_linux fmt::fmt-header-only Qt6::Core)
endif()
2 changes: 1 addition & 1 deletion src/platform/update/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ add_library(update STATIC

target_link_libraries(update
network
fmt
fmt::fmt-header-only
rpc
semver
Qt6::Core)
Expand Down
2 changes: 1 addition & 1 deletion src/settings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ add_library(settings STATIC
settings.cpp)

target_link_libraries(settings
fmt
fmt::fmt-header-only
utils
Qt6::Core)
6 changes: 3 additions & 3 deletions src/ssh/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function(add_ssh_target TARGET_NAME)
ssh_session.cpp)

target_link_libraries(${TARGET_NAME}
fmt
fmt::fmt-header-only
libssh
utils
Qt6::Core)
Expand All @@ -40,7 +40,7 @@ function(add_sftp_client_target TARGET_NAME)
ssh_session.cpp)

target_link_libraries(${TARGET_NAME}
fmt
fmt::fmt-header-only
libssh
utils
Qt6::Core)
Expand All @@ -58,7 +58,7 @@ function(add_ssh_client_target TARGET_NAME)

target_link_libraries(${TARGET_NAME}
console
fmt
fmt::fmt-header-only
libssh
utils
Qt6::Core)
Expand Down
2 changes: 1 addition & 1 deletion src/sshfs_mount/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function(add_sshfs_mount_target TARGET_NAME)
${CMAKE_SOURCE_DIR}/include/multipass/sshfs_mount/sshfs_mount_handler.h)

target_link_libraries(${TARGET_NAME}
fmt
fmt::fmt-header-only
logger
platform
ssh
Expand Down
2 changes: 1 addition & 1 deletion src/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function(add_target TARGET_NAME)

target_link_libraries(${TARGET_NAME}
cert
fmt
fmt::fmt-header-only
logger
ssh_common
ssh
Expand Down
2 changes: 1 addition & 1 deletion src/xz_decoder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ add_library(xz_image_decoder STATIC

target_link_libraries(xz_image_decoder
xz-embedded
fmt
fmt::fmt-header-only
rpc
Qt6::Core)
10 changes: 9 additions & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{
"$comment-about-baseline": "The baseline is intentionally kept at 2024.02.14 because gRPC does not like the changes in the latest baseline.",
"builtin-baseline": "fba75d09065fcc76a25dcf386b1d00d33f5175af",
"dependencies": [
"poco",
"grpc"
"grpc",
"fmt"
],
"overrides": [
{
"name": "fmt",
"version": "11.0.2"
}
]
}

0 comments on commit fcfd598

Please sign in to comment.