Skip to content

Commit 421231a

Browse files
committed
Fix wasm compile errors with emsdk-3.1.68+
1 parent 2d875dd commit 421231a

File tree

22 files changed

+3658
-4049
lines changed

22 files changed

+3658
-4049
lines changed

1k/manifest.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if ($Global:is_axmol_app -or $Global:is_axmol_engine) {
1212
$manifest['nuget'] = '5.5.1' # since 5.6.0, requires .net 4.0
1313
$manifest['glslcc'] = '1.9.5+'
1414
$manifest['cmake'] = '3.29.3~3.30.5+'
15-
$manifest['emsdk'] = '3.1.66~3.1.68+'
15+
$manifest['emsdk'] = '3.1.66~3.1.69+'
1616
$manifest['jdk'] = '17.0.10~17.0.12+'
1717
$manifest['vs'] = '16.0+'
1818
}

3rdparty/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767

6868
## {fmt}
6969
- [![Upstream](https://img.shields.io/github/v/release/fmtlib/fmt?label=Upstream)](https://github.com/fmtlib/fmt)
70-
- Version: 11.0.2
70+
- Version: 11.0.2-601be1c
71+
7172
- License: MIT
7273

7374
## FreeType

3rdparty/fmt/CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,13 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
240240
endif ()
241241
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
242242
set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} -Wshift-overflow=2
243-
-Wnull-dereference -Wduplicated-cond)
243+
-Wduplicated-cond)
244+
# Workaround for GCC regression
245+
# [12/13/14/15 regression] New (since gcc 12) false positive null-dereference in vector.resize
246+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108860
247+
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0)
248+
set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} -Wnull-dereference)
249+
endif ()
244250
endif ()
245251
set(WERROR_FLAG -Werror)
246252
endif ()
@@ -319,7 +325,7 @@ else ()
319325
message(WARNING "Feature cxx_std_11 is unknown for the CXX compiler")
320326
endif ()
321327

322-
target_include_directories(fmt ${FMT_SYSTEM_HEADERS_ATTRIBUTE} PUBLIC
328+
target_include_directories(fmt ${FMT_SYSTEM_HEADERS_ATTRIBUTE} BEFORE PUBLIC
323329
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
324330
$<INSTALL_INTERFACE:${FMT_INC_DIR}>)
325331

@@ -359,8 +365,8 @@ if (NOT MSVC)
359365
# Unicode is always supported on compilers other than MSVC.
360366
elseif (FMT_UNICODE)
361367
# Unicode support requires compiling with /utf-8.
362-
target_compile_options(fmt PUBLIC $<$<COMPILE_LANGUAGE:CXX>:/utf-8>)
363-
target_compile_options(fmt-header-only INTERFACE $<$<COMPILE_LANGUAGE:CXX>:/utf-8>)
368+
target_compile_options(fmt PUBLIC $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:MSVC>>:/utf-8>)
369+
target_compile_options(fmt-header-only INTERFACE $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:MSVC>>:/utf-8>)
364370
else ()
365371
target_compile_definitions(fmt PUBLIC FMT_UNICODE=0)
366372
endif ()
@@ -369,7 +375,7 @@ target_compile_definitions(fmt-header-only INTERFACE FMT_HEADER_ONLY=1)
369375
target_compile_features(fmt-header-only INTERFACE cxx_std_11)
370376

371377
target_include_directories(fmt-header-only
372-
${FMT_SYSTEM_HEADERS_ATTRIBUTE} INTERFACE
378+
${FMT_SYSTEM_HEADERS_ATTRIBUTE} BEFORE INTERFACE
373379
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
374380
$<INSTALL_INTERFACE:${FMT_INC_DIR}>)
375381

3rdparty/fmt/ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 11.1.0 - TBD
2+
3+
- Improved debug codegen.
4+
15
# 11.0.2 - 2024-07-20
26

37
- Fixed compatibility with non-POSIX systems

3rdparty/fmt/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ converts to `std::print`.)
291291
- [ccache](https://ccache.dev/): a compiler cache
292292
- [ClickHouse](https://github.com/ClickHouse/ClickHouse): an
293293
analytical database management system
294+
- [ContextVision](https://www.contextvision.com/): medical imaging software
294295
- [Contour](https://github.com/contour-terminal/contour/): a modern
295296
terminal emulator
296297
- [CUAUV](https://cuauv.org/): Cornell University\'s autonomous

3rdparty/fmt/include/fmt/args.h

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "format.h" // std_string_view
1818

1919
FMT_BEGIN_NAMESPACE
20-
2120
namespace detail {
2221

2322
template <typename T> struct is_reference_wrapper : std::false_type {};
@@ -72,19 +71,13 @@ class dynamic_arg_list {
7271
* It can be implicitly converted into `fmt::basic_format_args` for passing
7372
* into type-erased formatting functions such as `fmt::vformat`.
7473
*/
75-
template <typename Context>
76-
class dynamic_format_arg_store
77-
#if FMT_GCC_VERSION && FMT_GCC_VERSION < 409
78-
// Workaround a GCC template argument substitution bug.
79-
: public basic_format_args<Context>
80-
#endif
81-
{
74+
template <typename Context> class dynamic_format_arg_store {
8275
private:
8376
using char_type = typename Context::char_type;
8477

8578
template <typename T> struct need_copy {
8679
static constexpr detail::type mapped_type =
87-
detail::mapped_type_constant<T, Context>::value;
80+
detail::mapped_type_constant<T, char_type>::value;
8881

8982
enum {
9083
value = !(detail::is_reference_wrapper<T>::value ||
@@ -97,7 +90,7 @@ class dynamic_format_arg_store
9790
};
9891

9992
template <typename T>
100-
using stored_type = conditional_t<
93+
using stored_t = conditional_t<
10194
std::is_convertible<T, std::basic_string<char_type>>::value &&
10295
!detail::is_reference_wrapper<T>::value,
10396
std::basic_string<char_type>, T>;
@@ -112,41 +105,37 @@ class dynamic_format_arg_store
112105

113106
friend class basic_format_args<Context>;
114107

115-
auto get_types() const -> unsigned long long {
116-
return detail::is_unpacked_bit | data_.size() |
117-
(named_info_.empty()
118-
? 0ULL
119-
: static_cast<unsigned long long>(detail::has_named_args_bit));
120-
}
121-
122108
auto data() const -> const basic_format_arg<Context>* {
123109
return named_info_.empty() ? data_.data() : data_.data() + 1;
124110
}
125111

126112
template <typename T> void emplace_arg(const T& arg) {
127-
data_.emplace_back(detail::make_arg<Context>(arg));
113+
data_.emplace_back(arg);
128114
}
129115

130116
template <typename T>
131117
void emplace_arg(const detail::named_arg<char_type, T>& arg) {
132-
if (named_info_.empty()) {
133-
constexpr const detail::named_arg_info<char_type>* zero_ptr{nullptr};
134-
data_.insert(data_.begin(), {zero_ptr, 0});
135-
}
136-
data_.emplace_back(detail::make_arg<Context>(detail::unwrap(arg.value)));
118+
if (named_info_.empty())
119+
data_.insert(data_.begin(), basic_format_arg<Context>(nullptr, 0));
120+
data_.emplace_back(detail::unwrap(arg.value));
137121
auto pop_one = [](std::vector<basic_format_arg<Context>>* data) {
138122
data->pop_back();
139123
};
140124
std::unique_ptr<std::vector<basic_format_arg<Context>>, decltype(pop_one)>
141125
guard{&data_, pop_one};
142126
named_info_.push_back({arg.name, static_cast<int>(data_.size() - 2u)});
143-
data_[0].value_.named_args = {named_info_.data(), named_info_.size()};
127+
data_[0] = {named_info_.data(), named_info_.size()};
144128
guard.release();
145129
}
146130

147131
public:
148132
constexpr dynamic_format_arg_store() = default;
149133

134+
operator basic_format_args<Context>() const {
135+
return basic_format_args<Context>(data(), static_cast<int>(data_.size()),
136+
!named_info_.empty());
137+
}
138+
150139
/**
151140
* Adds an argument into the dynamic store for later passing to a formatting
152141
* function.
@@ -164,7 +153,7 @@ class dynamic_format_arg_store
164153
*/
165154
template <typename T> void push_back(const T& arg) {
166155
if (detail::const_check(need_copy<T>::value))
167-
emplace_arg(dynamic_args_.push<stored_type<T>>(arg));
156+
emplace_arg(dynamic_args_.push<stored_t<T>>(arg));
168157
else
169158
emplace_arg(detail::unwrap(arg));
170159
}
@@ -200,7 +189,7 @@ class dynamic_format_arg_store
200189
dynamic_args_.push<std::basic_string<char_type>>(arg.name).c_str();
201190
if (detail::const_check(need_copy<T>::value)) {
202191
emplace_arg(
203-
fmt::arg(arg_name, dynamic_args_.push<stored_type<T>>(arg.value)));
192+
fmt::arg(arg_name, dynamic_args_.push<stored_t<T>>(arg.value)));
204193
} else {
205194
emplace_arg(fmt::arg(arg_name, arg.value));
206195
}
@@ -210,14 +199,14 @@ class dynamic_format_arg_store
210199
void clear() {
211200
data_.clear();
212201
named_info_.clear();
213-
dynamic_args_ = detail::dynamic_arg_list();
202+
dynamic_args_ = {};
214203
}
215204

216205
/// Reserves space to store at least `new_cap` arguments including
217206
/// `new_cap_named` named arguments.
218207
void reserve(size_t new_cap, size_t new_cap_named) {
219208
FMT_ASSERT(new_cap >= new_cap_named,
220-
"Set of arguments includes set of named arguments");
209+
"set of arguments includes set of named arguments");
221210
data_.reserve(new_cap);
222211
named_info_.reserve(new_cap_named);
223212
}

0 commit comments

Comments
 (0)