Skip to content

Commit 68d4f0f

Browse files
authored
Merge pull request #515 from julcst/fix-fmt
Fix fmt compilation in C++20
2 parents a9890e6 + d1363f8 commit 68d4f0f

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,9 @@ set(BUILD_SHARED_LIBS OFF)
285285

286286
if (TCNN_EXTERNAL_FMT)
287287
list(APPEND TCNN_LIBRARIES "${TCNN_EXTERNAL_FMT}")
288+
list(APPEND TCNN_DEFINITIONS -DFMT_UNICODE=0)
288289
else()
290+
set(FMT_UNICODE OFF CACHE BOOL " " FORCE)
289291
add_subdirectory("dependencies/fmt")
290292
list(APPEND TCNN_LIBRARIES fmt)
291293
list(APPEND TCNN_INCLUDES "dependencies/fmt/include")

dependencies/fmt

Submodule fmt updated 198 files

include/tiny-cuda-nn/common_host.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void set_log_callback(const std::function<void(LogSeverity, const std::string&)>
5656

5757
template <typename... Ts>
5858
void log(LogSeverity severity, const std::string& msg, Ts&&... args) {
59-
log_callback()(severity, fmt::format(msg, std::forward<Ts>(args)...));
59+
log_callback()(severity, fmt::format(fmt::runtime(msg), std::forward<Ts>(args)...));
6060
}
6161

6262
template <typename... Ts> void log_info(const std::string& msg, Ts&&... args) { log(LogSeverity::Info, msg, std::forward<Ts>(args)...); }
@@ -304,7 +304,7 @@ std::string dfmt(uint32_t indent, const std::string& format, Ts&&... args) {
304304
}
305305
}
306306

307-
return fmt::format(join(lines, "\n"), std::forward<Ts>(args)...);
307+
return fmt::format(fmt::runtime(join(lines, "\n")), std::forward<Ts>(args)...);
308308
}
309309

310310
std::string to_lower(std::string str);

0 commit comments

Comments
 (0)