mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-10-22 07:21:21 +00:00
fmt: test for fmt::runtime() & require v8.0.0 or later
This commit is contained in:
parent
1d48a6235d
commit
bb6aa513a2
5
NEWS.md
5
NEWS.md
@ -22,6 +22,11 @@
|
||||
being copied when very large values were present in source files, or in
|
||||
error messages when very large values were used as command-line parameters.
|
||||
|
||||
## Build system changes
|
||||
|
||||
* Release v8.0.0 of the `fmt` library is now required. If not found, the
|
||||
bundled copy will be used.
|
||||
|
||||
|
||||
# Version 83.0 "Circle Of Friends" 2024-03-10
|
||||
|
||||
|
@ -124,7 +124,7 @@ distribution instead of relying on the bundled versions.
|
||||
These libraries are:
|
||||
|
||||
- [fmt](http://fmtlib.net/) — a small, safe and fast formatting
|
||||
library. Version 6.1.0 or later is required.
|
||||
library. Version 8.0.0 or later is required.
|
||||
|
||||
- [libEBML v1.4.4](http://dl.matroska.org/downloads/libebml/) or later
|
||||
and [libMatroska v1.7.1](http://dl.matroska.org/downloads/libmatroska/)
|
||||
|
27
ac/fmt.m4
27
ac/fmt.m4
@ -15,28 +15,15 @@ AC_CACHE_CHECK([fmt],[ac_cv_fmt],[
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/ostream.h>
|
||||
|
||||
#if !defined(FMT_VERSION) || (FMT_VERSION < 60100)
|
||||
#error fmtlib is too old, need 6.1.0 or later
|
||||
#if !defined(FMT_VERSION) || (FMT_VERSION < 80000)
|
||||
#error fmtlib is too old, need 8.0.0 or later
|
||||
#endif
|
||||
]], [[
|
||||
fmt::format("{0:02}", fmt::to_string(4254));
|
||||
fmt::format("{0}", fmt::to_string(4254));
|
||||
std::string moo{"'{0}' says the cow"};
|
||||
fmt::format(fmt::runtime(moo), "moo");
|
||||
]])],[ac_cv_fmt=yes],[ac_cv_fmt=no])
|
||||
|
||||
AC_CACHE_VAL(ac_cv_fmt_v8, [
|
||||
if test $ac_cv_fmt=yes; then
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/ostream.h>
|
||||
|
||||
#if !defined(FMT_VERSION) || (FMT_VERSION < 80000)
|
||||
#error fmt is older than v8
|
||||
#endif
|
||||
]], [[
|
||||
fmt::format("{0:02}", fmt::to_string(4254));
|
||||
]])],[ac_cv_fmt_v8=yes],[ac_cv_fmt_v8=no])
|
||||
fi
|
||||
])
|
||||
|
||||
CXXFLAGS="$ac_save_CXXFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
|
||||
@ -48,10 +35,6 @@ if test x"$ac_cv_fmt" = xyes; then
|
||||
else
|
||||
AC_MSG_NOTICE([Using the internal version of fmt])
|
||||
FMT_INTERNAL=yes
|
||||
ac_cv_fmt_v8=yes
|
||||
fi
|
||||
|
||||
if test $ac_cv_fmt_v8 = yes; then
|
||||
AC_DEFINE([HAVE_FMT_V8],[1],[Define if the fmt library is v8 or newer])
|
||||
fi
|
||||
AC_SUBST(FMT_INTERNAL)
|
||||
|
@ -33,12 +33,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if !defined(HAVE_FMT_V8) || !HAVE_FMT_V8
|
||||
// Don't support user-defined literals in fmt as they aren't used by
|
||||
// MKVToolNix and produce a compiler warning in -Wpedantic with fmt < v8
|
||||
# define FMT_USE_USER_DEFINED_LITERALS 0
|
||||
#endif
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/ostream.h>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user