Skip to content

Commit

Permalink
Rollback fmt to 11.0.2 & emsdk to 3.1.67
Browse files Browse the repository at this point in the history
- genbindings llvm-15.0.7 can't works on fmt latest: unknown template argument
- fmt 11.0.2 can't compile on emsdk 3.1.68+
  • Loading branch information
halx99 committed Oct 20, 2024
1 parent 7be0021 commit 5d9b18d
Show file tree
Hide file tree
Showing 23 changed files with 4,059 additions and 3,663 deletions.
2 changes: 1 addition & 1 deletion 1k/manifest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if ($Global:is_axmol_app -or $Global:is_axmol_engine) {
$manifest['nuget'] = '5.5.1' # since 5.6.0, requires .net 4.0
$manifest['glslcc'] = '1.9.5+'
$manifest['cmake'] = '3.29.3~3.30.5+'
$manifest['emsdk'] = '3.1.66~3.1.69+'
$manifest['emsdk'] = '3.1.66~3.1.67+'
$manifest['jdk'] = '17.0.10~17.0.12+'
$manifest['vs'] = '16.0+'
}
Expand Down
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.0.2-601be1c
- Version: 11.0.2

- License: MIT

Expand Down
16 changes: 5 additions & 11 deletions 3rdparty/fmt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
endif ()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} -Wshift-overflow=2
-Wduplicated-cond)
# Workaround for GCC regression
# [12/13/14/15 regression] New (since gcc 12) false positive null-dereference in vector.resize
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108860
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0)
set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} -Wnull-dereference)
endif ()
-Wnull-dereference -Wduplicated-cond)
endif ()
set(WERROR_FLAG -Werror)
endif ()
Expand Down Expand Up @@ -325,7 +319,7 @@ else ()
message(WARNING "Feature cxx_std_11 is unknown for the CXX compiler")
endif ()

target_include_directories(fmt ${FMT_SYSTEM_HEADERS_ATTRIBUTE} BEFORE PUBLIC
target_include_directories(fmt ${FMT_SYSTEM_HEADERS_ATTRIBUTE} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${FMT_INC_DIR}>)

Expand Down Expand Up @@ -365,8 +359,8 @@ if (NOT MSVC)
# Unicode is always supported on compilers other than MSVC.
elseif (FMT_UNICODE)
# Unicode support requires compiling with /utf-8.
target_compile_options(fmt PUBLIC $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:MSVC>>:/utf-8>)
target_compile_options(fmt-header-only INTERFACE $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:MSVC>>:/utf-8>)
target_compile_options(fmt PUBLIC $<$<COMPILE_LANGUAGE:CXX>:/utf-8>)
target_compile_options(fmt-header-only INTERFACE $<$<COMPILE_LANGUAGE:CXX>:/utf-8>)
else ()
target_compile_definitions(fmt PUBLIC FMT_UNICODE=0)
endif ()
Expand All @@ -375,7 +369,7 @@ target_compile_definitions(fmt-header-only INTERFACE FMT_HEADER_ONLY=1)
target_compile_features(fmt-header-only INTERFACE cxx_std_11)

target_include_directories(fmt-header-only
${FMT_SYSTEM_HEADERS_ATTRIBUTE} BEFORE INTERFACE
${FMT_SYSTEM_HEADERS_ATTRIBUTE} INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${FMT_INC_DIR}>)

Expand Down
4 changes: 0 additions & 4 deletions 3rdparty/fmt/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# 11.1.0 - TBD

- Improved debug codegen.

# 11.0.2 - 2024-07-20

- Fixed compatibility with non-POSIX systems
Expand Down
1 change: 0 additions & 1 deletion 3rdparty/fmt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ converts to `std::print`.)
- [ccache](https://ccache.dev/): a compiler cache
- [ClickHouse](https://github.com/ClickHouse/ClickHouse): an
analytical database management system
- [ContextVision](https://www.contextvision.com/): medical imaging software
- [Contour](https://github.com/contour-terminal/contour/): a modern
terminal emulator
- [CUAUV](https://cuauv.org/): Cornell University\'s autonomous
Expand Down
45 changes: 28 additions & 17 deletions 3rdparty/fmt/include/fmt/args.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "format.h" // std_string_view

FMT_BEGIN_NAMESPACE

namespace detail {

template <typename T> struct is_reference_wrapper : std::false_type {};
Expand Down Expand Up @@ -71,13 +72,19 @@ class dynamic_arg_list {
* It can be implicitly converted into `fmt::basic_format_args` for passing
* into type-erased formatting functions such as `fmt::vformat`.
*/
template <typename Context> class dynamic_format_arg_store {
template <typename Context>
class dynamic_format_arg_store
#if FMT_GCC_VERSION && FMT_GCC_VERSION < 409
// Workaround a GCC template argument substitution bug.
: public basic_format_args<Context>
#endif
{
private:
using char_type = typename Context::char_type;

template <typename T> struct need_copy {
static constexpr detail::type mapped_type =
detail::mapped_type_constant<T, char_type>::value;
detail::mapped_type_constant<T, Context>::value;

enum {
value = !(detail::is_reference_wrapper<T>::value ||
Expand All @@ -90,7 +97,7 @@ template <typename Context> class dynamic_format_arg_store {
};

template <typename T>
using stored_t = conditional_t<
using stored_type = conditional_t<
std::is_convertible<T, std::basic_string<char_type>>::value &&
!detail::is_reference_wrapper<T>::value,
std::basic_string<char_type>, T>;
Expand All @@ -105,37 +112,41 @@ template <typename Context> class dynamic_format_arg_store {

friend class basic_format_args<Context>;

auto get_types() const -> unsigned long long {
return detail::is_unpacked_bit | data_.size() |
(named_info_.empty()
? 0ULL
: static_cast<unsigned long long>(detail::has_named_args_bit));
}

auto data() const -> const basic_format_arg<Context>* {
return named_info_.empty() ? data_.data() : data_.data() + 1;
}

template <typename T> void emplace_arg(const T& arg) {
data_.emplace_back(arg);
data_.emplace_back(detail::make_arg<Context>(arg));
}

template <typename T>
void emplace_arg(const detail::named_arg<char_type, T>& arg) {
if (named_info_.empty())
data_.insert(data_.begin(), basic_format_arg<Context>(nullptr, 0));
data_.emplace_back(detail::unwrap(arg.value));
if (named_info_.empty()) {
constexpr const detail::named_arg_info<char_type>* zero_ptr{nullptr};
data_.insert(data_.begin(), {zero_ptr, 0});
}
data_.emplace_back(detail::make_arg<Context>(detail::unwrap(arg.value)));
auto pop_one = [](std::vector<basic_format_arg<Context>>* data) {
data->pop_back();
};
std::unique_ptr<std::vector<basic_format_arg<Context>>, decltype(pop_one)>
guard{&data_, pop_one};
named_info_.push_back({arg.name, static_cast<int>(data_.size() - 2u)});
data_[0] = {named_info_.data(), named_info_.size()};
data_[0].value_.named_args = {named_info_.data(), named_info_.size()};
guard.release();
}

public:
constexpr dynamic_format_arg_store() = default;

operator basic_format_args<Context>() const {
return basic_format_args<Context>(data(), static_cast<int>(data_.size()),
!named_info_.empty());
}

/**
* Adds an argument into the dynamic store for later passing to a formatting
* function.
Expand All @@ -153,7 +164,7 @@ template <typename Context> class dynamic_format_arg_store {
*/
template <typename T> void push_back(const T& arg) {
if (detail::const_check(need_copy<T>::value))
emplace_arg(dynamic_args_.push<stored_t<T>>(arg));
emplace_arg(dynamic_args_.push<stored_type<T>>(arg));
else
emplace_arg(detail::unwrap(arg));
}
Expand Down Expand Up @@ -189,7 +200,7 @@ template <typename Context> class dynamic_format_arg_store {
dynamic_args_.push<std::basic_string<char_type>>(arg.name).c_str();
if (detail::const_check(need_copy<T>::value)) {
emplace_arg(
fmt::arg(arg_name, dynamic_args_.push<stored_t<T>>(arg.value)));
fmt::arg(arg_name, dynamic_args_.push<stored_type<T>>(arg.value)));
} else {
emplace_arg(fmt::arg(arg_name, arg.value));
}
Expand All @@ -199,14 +210,14 @@ template <typename Context> class dynamic_format_arg_store {
void clear() {
data_.clear();
named_info_.clear();
dynamic_args_ = {};
dynamic_args_ = detail::dynamic_arg_list();
}

/// Reserves space to store at least `new_cap` arguments including
/// `new_cap_named` named arguments.
void reserve(size_t new_cap, size_t new_cap_named) {
FMT_ASSERT(new_cap >= new_cap_named,
"set of arguments includes set of named arguments");
"Set of arguments includes set of named arguments");
data_.reserve(new_cap);
named_info_.reserve(new_cap_named);
}
Expand Down
Loading

0 comments on commit 5d9b18d

Please sign in to comment.