From 55dd9dca9af174f9bad3d090901062d6f8e9c6c4 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 18 Sep 2021 13:53:00 +0200 Subject: disallow old <7.0 fmt libfmt 6.1 is in Ubuntu focal repositories. it's easy to compile with 6.1 by doing #define detail internal but 6.1 also produces different results in main.func_sformat and we want MariaDB to behave identically everywhere. --- cmake/libfmt.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/libfmt.cmake b/cmake/libfmt.cmake index 27ac5a6ff85..99e7b0d9aab 100644 --- a/cmake/libfmt.cmake +++ b/cmake/libfmt.cmake @@ -28,12 +28,15 @@ MACRO (CHECK_LIBFMT) #include #include int main() { - std::cout << fmt::format(\"The answer is {}.\", 42); + fmt::format_args::format_arg arg= + fmt::detail::make_arg(42); + std::cout << fmt::vformat(\"The answer is {}.\", + fmt::format_args(&arg, 1)); }" HAVE_SYSTEM_LIBFMT) ENDIF() IF(NOT HAVE_SYSTEM_LIBFMT OR WITH_LIBFMT STREQUAL "bundled") IF (WITH_LIBFMT STREQUAL "system") - MESSAGE(FATAL_ERROR "system libfmt library is not found") + MESSAGE(FATAL_ERROR "system libfmt library is not found or unusable") ENDIF() BUNDLE_LIBFMT() ELSE() -- cgit v1.2.1