Skip to content

Commit

Permalink
Update fmt to v11.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Dec 30, 2024
1 parent 46b6862 commit 877e252
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 27 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

## {fmt}
- [![Upstream](https://img.shields.io/github/v/release/fmtlib/fmt?label=Upstream)](https://github.com/fmtlib/fmt)
- Version: 11.1.0
- Version: 11.1.1

- License: MIT

Expand Down
19 changes: 12 additions & 7 deletions 3rdparty/fmt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,9 @@ if (FMT_INSTALL)
endif()

# Install the library and headers.
install(TARGETS ${INSTALL_TARGETS} EXPORT ${targets_export_name}
install(TARGETS ${INSTALL_TARGETS}
COMPONENT core
EXPORT ${targets_export_name}
LIBRARY DESTINATION ${FMT_LIB_DIR}
ARCHIVE DESTINATION ${FMT_LIB_DIR}
PUBLIC_HEADER DESTINATION "${FMT_INC_DIR}/fmt"
Expand All @@ -439,13 +441,15 @@ if (FMT_INSTALL)
FILE ${PROJECT_BINARY_DIR}/${targets_export_name}.cmake)

# Install version, config and target files.
install(
FILES ${project_config} ${version_config}
DESTINATION ${FMT_CMAKE_DIR})
install(FILES ${project_config} ${version_config}
DESTINATION ${FMT_CMAKE_DIR}
COMPONENT core)
install(EXPORT ${targets_export_name} DESTINATION ${FMT_CMAKE_DIR}
NAMESPACE fmt::)
NAMESPACE fmt::
COMPONENT core)

install(FILES "${pkgconfig}" DESTINATION "${FMT_PKGCONFIG_DIR}")
install(FILES "${pkgconfig}" DESTINATION "${FMT_PKGCONFIG_DIR}"
COMPONENT core)
endif ()

function(add_doc_target)
Expand Down Expand Up @@ -481,7 +485,8 @@ function(add_doc_target)

include(GNUInstallDirs)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc-html/
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/fmt OPTIONAL)
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/fmt
COMPONENT doc OPTIONAL)
endfunction()

if (FMT_DOC)
Expand Down
9 changes: 9 additions & 0 deletions 3rdparty/fmt/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 11.1.1 - 2024-12-27

- Fixed ABI compatibility with earlier 11.x versions
(https://github.com/fmtlib/fmt/issues/4278).

- Defined CMake components (`core` and `doc`) to allow docs to be installed
separately (https://github.com/fmtlib/fmt/pull/4276).
Thanks @carlsmedstad.

# 11.1.0 - 2024-12-25

- Improved C++20 module support
Expand Down
26 changes: 21 additions & 5 deletions 3rdparty/fmt/include/fmt/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#endif

// The fmt library version in the form major * 10000 + minor * 100 + patch.
#define FMT_VERSION 110100
#define FMT_VERSION 110101

// Detect compiler versions.
#if defined(__clang__) && !defined(__ibmxl__)
Expand Down Expand Up @@ -161,6 +161,20 @@
# define FMT_CATCH(x) if (false)
#endif

#ifdef FMT_NO_UNIQUE_ADDRESS
// Use the provided definition.
#elif FMT_CPLUSPLUS < 202002L
// Not supported.
#elif FMT_HAS_CPP_ATTRIBUTE(no_unique_address)
# define FMT_NO_UNIQUE_ADDRESS [[no_unique_address]]
// VS2019 v16.10 and later except clang-cl (https://reviews.llvm.org/D110485).
#elif FMT_MSC_VERSION >= 1929 && !FMT_CLANG_VERSION
# define FMT_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
#endif
#ifndef FMT_NO_UNIQUE_ADDRESS
# define FMT_NO_UNIQUE_ADDRESS
#endif

#if FMT_HAS_CPP17_ATTRIBUTE(fallthrough)
# define FMT_FALLTHROUGH [[fallthrough]]
#elif defined(__clang__)
Expand Down Expand Up @@ -2604,10 +2618,11 @@ template <typename Context> class basic_format_args {
};

// A formatting context.
class context : private detail::locale_ref {
class context {
private:
appender out_;
format_args args_;
FMT_NO_UNIQUE_ADDRESS detail::locale_ref loc_;

public:
/// The character type for the output.
Expand All @@ -2623,7 +2638,7 @@ class context : private detail::locale_ref {
/// in the object so make sure they have appropriate lifetimes.
FMT_CONSTEXPR context(iterator out, format_args args,
detail::locale_ref loc = {})
: locale_ref(loc), out_(out), args_(args) {}
: out_(out), args_(args), loc_(loc) {}
context(context&&) = default;
context(const context&) = delete;
void operator=(const context&) = delete;
Expand All @@ -2642,7 +2657,7 @@ class context : private detail::locale_ref {
// Advances the begin iterator to `it`.
FMT_CONSTEXPR void advance_to(iterator) {}

FMT_CONSTEXPR auto locale() const -> detail::locale_ref { return *this; }
FMT_CONSTEXPR auto locale() const -> detail::locale_ref { return loc_; }
};

template <typename Char = char> struct runtime_format_string {
Expand All @@ -2659,7 +2674,8 @@ template <typename Char = char> struct runtime_format_string {
*/
inline auto runtime(string_view s) -> runtime_format_string<> { return {{s}}; }

/// A compile-time format string.
/// A compile-time format string. Use `format_string` in the public API to
/// prevent type deduction.
template <typename... T> struct fstring {
private:
static constexpr int num_static_named_args =
Expand Down
14 changes: 0 additions & 14 deletions 3rdparty/fmt/include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,6 @@ FMT_END_NAMESPACE
# endif // FMT_USE_EXCEPTIONS
#endif // FMT_THROW

#ifdef FMT_NO_UNIQUE_ADDRESS
// Use the provided definition.
#elif FMT_CPLUSPLUS < 202002L
// Not supported.
#elif FMT_HAS_CPP_ATTRIBUTE(no_unique_address)
# define FMT_NO_UNIQUE_ADDRESS [[no_unique_address]]
// VS2019 v16.10 and later except clang-cl (https://reviews.llvm.org/D110485).
#elif FMT_MSC_VERSION >= 1929 && !FMT_CLANG_VERSION
# define FMT_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
#endif
#ifndef FMT_NO_UNIQUE_ADDRESS
# define FMT_NO_UNIQUE_ADDRESS
#endif

// Defining FMT_REDUCE_INT_INSTANTIATIONS to 1, will reduce the number of
// integer formatter template instantiations to just one by only using the
// largest integer type. This results in a reduction in binary size but will
Expand Down

0 comments on commit 877e252

Please sign in to comment.