Skip to content

Commit

Permalink
disallow old <7.0 fmt
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vuvova committed Oct 12, 2021
1 parent 513c8b4 commit ba7287d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmake/libfmt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@ MACRO (CHECK_LIBFMT)
#include <fmt/format-inl.h>
#include <iostream>
int main() {
std::cout << fmt::format(\"The answer is {}.\", 42);
fmt::format_args::format_arg arg=
fmt::detail::make_arg<fmt::format_context>(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()
Expand Down

0 comments on commit ba7287d

Please sign in to comment.