Fix MSVC toolchain path_fiddle builds (#10661) 0f0d7c5f81

Our MSVC builds are building with C++latest (instead of C++17), and what that means is that filesystem::path::u8string returns a std::u8string instead of std::string (see https://en.cppreference.com/w/cpp/filesystem/path/string.html), causing a compilation failure for the shader hotload rebuild command. This change adds back in the reinterpret_cast to a char pointer (but still stores the temp string correctly).

Co-authored-by: Josh Jersild <joshua@rive.app>
This commit is contained in:
JoshJRive
2025-09-25 18:58:46 +00:00
parent 1197a7f42c
commit f15f139dce
2 changed files with 7 additions and 3 deletions

View File

@@ -1 +1 @@
0121fd017478dcb91ad60e7f48af043a61e6104f
0f0d7c5f813080c2fbc0f81e3f17ab6f518799dd

View File

@@ -856,8 +856,12 @@ void riveMainLoop()
// windows where the native path character type is wchar_t, then
// reinterpret_cast the char8_t pointer to char so we can append it to
// our string.
// Store the u8string result to extend its lifetime
std::string tempRiveDirStr = tempRiveDir.u8string();
// Store the u8string result to extend its lifetime (need to
// reinterpret_cast through a const char * pointer because u8string
// returns a std::u8string in C++20 and newer, but we need it as a
// "char" string)
std::string tempRiveDirStr =
reinterpret_cast<const char*>(tempRiveDir.u8string().c_str());
std::string rebuildCommand = "sh rebuild_shaders.sh " + tempRiveDirStr;
std::system(rebuildCommand.c_str());