mirror of
https://github.com/GerbilSoft/rom-properties.git
synced 2025-06-18 19:45:41 -04:00
[libfmt] Require libfmt-7.1.0 or later in order to use a system-wide version.
- libfmt-6.2.0: Introduced the 'L' format specifier. - Previously, 'n' was available. - The 'L' specifier matches C++20 std::format(). - libfmt-7.0.x: Has fixes for the 'L' format specifier; removed 'n'. - 'n' can be re-enabled with FMT_DEPRECATED_N_SPECIFIER. - libfmt-7.1.0: Has more fixes for the 'L' format specifier. - libfmt-8.0.0: Removes the 'n' format specifier entirely. Since we use the 'L' specifier, we will set a minimum of libfmt-7.1.0. Ubuntu 20.04 has libfmt-6.1.2; Ubuntu 22.04 has libfmt-8.1.1. Also, Ubuntu 20.04's libfmt is a static library. It was changed to a shared library sometime between 20.04 and 22.04. rp-libfmt.h: Removed macros for compatibility with versions of libfmt older than 7.1.0.
This commit is contained in:
parent
ddbd5ca03d
commit
02a55c2dad
@ -11,7 +11,19 @@ IF(NOT USE_INTERNAL_FMT)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Check for libfmt.
|
# Check for libfmt.
|
||||||
FIND_PACKAGE(Fmt)
|
# - libfmt-6.2.0: Introduced the 'L' format specifier.
|
||||||
|
# - Previously, 'n' was available.
|
||||||
|
# - The 'L' specifier matches C++20 std::format().
|
||||||
|
# - libfmt-7.0.x: Has fixes for the 'L' format specifier; removed 'n'.
|
||||||
|
# - 'n' can be re-enabled with FMT_DEPRECATED_N_SPECIFIER.
|
||||||
|
# - libfmt-7.1.0: Has more fixes for the 'L' format specifier.
|
||||||
|
# - libfmt-8.0.0: Removes the 'n' format specifier entirely.
|
||||||
|
#
|
||||||
|
# Since we use the 'L' specifier, we will set a minimum of libfmt-7.1.0.
|
||||||
|
# Ubuntu 20.04 has libfmt-6.1.2; Ubuntu 22.04 has libfmt-8.1.1.
|
||||||
|
# Also, Ubuntu 20.04's libfmt is a static library. It was changed
|
||||||
|
# to a shared library sometime between 20.04 and 22.04.
|
||||||
|
FIND_PACKAGE(Fmt 7.1.0)
|
||||||
IF(Fmt_FOUND)
|
IF(Fmt_FOUND)
|
||||||
# Found system libfmt.
|
# Found system libfmt.
|
||||||
SET(HAVE_Fmt 1)
|
SET(HAVE_Fmt 1)
|
||||||
|
@ -10,22 +10,13 @@
|
|||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
// libfmt [5.2.0, 7.0.0): Requires FMT_STRING_ALIAS=1.
|
|
||||||
// NOTE: We have to define this before including <fmt/format.h>,
|
|
||||||
// so it's defined unconditionally, regardless of libfmt version.
|
|
||||||
#define FMT_STRING_ALIAS 1
|
|
||||||
|
|
||||||
// Base libfmt header
|
// Base libfmt header
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
|
|
||||||
// FMT_STRING() prior to libfmt-7.0.0 was handled differently.
|
// libfmt-7.1.0 is required.
|
||||||
#if FMT_VERSION < 40000
|
#if FMT_VERSION < 70100
|
||||||
// libfmt 4.x and older: No compile-time format checks.
|
# error libfmt-7.1.0 or later is required!
|
||||||
# define FMT_STRING(x) x
|
#endif /* FMT_VERSION < 70100 */
|
||||||
#elif FMT_VERSION < 70000
|
|
||||||
// libfmt [5.0.0, 7.0.0): fmt() macro
|
|
||||||
# define FMT_STRING(x) fmt(x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Our own FSTR() macro
|
// Our own FSTR() macro
|
||||||
#define FSTR(x) FMT_STRING(x)
|
#define FSTR(x) FMT_STRING(x)
|
||||||
@ -37,9 +28,4 @@
|
|||||||
# endif /* FMT_VERSION >= 80000 */
|
# endif /* FMT_VERSION >= 80000 */
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
// libfmt-4.x: fmt::to_string() is in string.h.
|
|
||||||
#if FMT_VERSION >= 40000 && FMT_VERSION < 50000
|
|
||||||
# inculde <fmt/string.h>
|
|
||||||
#endif /* FMT_VERSION >= 40000 && FMT_VERSION < 50000 */
|
|
||||||
|
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
Loading…
Reference in New Issue
Block a user