From 986ea4a37b2b7f8928c9d98dd071ce805c0a42d9 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 9 May 2021 22:36:37 -0500 Subject: [PATCH] [ox/std] Fix Linux build (synced from 0bcb78d3da3c61d1598be2bc4ab39dd138bb8b97) --- src/ox/std/CMakeLists.txt | 1 + src/ox/std/fmt.hpp | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ox/std/CMakeLists.txt b/src/ox/std/CMakeLists.txt index cf71badd8..d859f9cc1 100644 --- a/src/ox/std/CMakeLists.txt +++ b/src/ox/std/CMakeLists.txt @@ -54,6 +54,7 @@ target_compile_definitions( target_link_libraries( OxStd PUBLIC + $<$:dl> $<$:gcc> OxTraceHook ) diff --git a/src/ox/std/fmt.hpp b/src/ox/std/fmt.hpp index dabf42fbf..6f2771afb 100644 --- a/src/ox/std/fmt.hpp +++ b/src/ox/std/fmt.hpp @@ -40,13 +40,18 @@ constexpr const char *stringify(const String &s) noexcept { } #if __has_include() -constexpr const char *stringify(const std::string &s) noexcept { +#if __cplusplus >= 202002L +constexpr +#else +inline +#endif +const char *stringify(const std::string &s) noexcept { return s.c_str(); } #endif #if __has_include() -constexpr const char *stringify(const QString &s) noexcept { +inline const char *stringify(const QString &s) noexcept { return s.toUtf8(); } #endif