Always link against fmt::fmt

Also ensure that this dependency is propagated to the installed config
file as necessary.
This commit is contained in:
Robert Adam
2026-06-14 15:44:57 +02:00
parent bd58e41fbe
commit 7dab10062d
3 changed files with 12 additions and 3 deletions

View File

@@ -149,8 +149,13 @@ function(soci_define_backend_target)
endforeach()
# Set settings common to all backends.
target_link_libraries(${DEFINE_BACKEND_TARGET_NAME} PUBLIC SOCI::Core PRIVATE $<BUILD_INTERFACE:fmt::fmt-header-only>)
target_link_libraries(${DEFINE_BACKEND_TARGET_NAME} PUBLIC SOCI::Core)
target_include_directories(${DEFINE_BACKEND_TARGET_NAME} PRIVATE "${PROJECT_SOURCE_DIR}/include/private")
soci_private_dependency(
NAME fmt
DEP_TARGETS fmt::fmt
TARGET "SOCI::${DEFINE_BACKEND_NAME}"
)
soci_build_library_name(full_backend_target_name "${DEFINE_BACKEND_TARGET_NAME}")

View File

@@ -125,7 +125,11 @@ if (SOCI_SHARED)
target_compile_definitions(soci_core PUBLIC SOCI_DLL)
endif()
target_link_libraries(soci_core PRIVATE $<BUILD_INTERFACE:fmt::fmt-header-only>)
soci_private_dependency(
NAME fmt
DEP_TARGETS fmt::fmt
TARGET SOCI::Core
)
if (WITH_BOOST)
# Try and find Boost with the date_time component.

View File

@@ -33,7 +33,7 @@ target_link_libraries(soci_tests_common
PUBLIC
soci_compiler_interface
SOCI::Core
$<BUILD_INTERFACE:fmt::fmt-header-only>
fmt::fmt
)
target_include_directories(soci_tests_common