More Emscripten build fixes

This commit is contained in:
Nikita Lisitsa 2026-07-03 11:38:03 +03:00
parent d290df3f29
commit a45d9b2779
2 changed files with 5 additions and 1 deletions

View file

@ -55,7 +55,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL Emscripten)
set(PSEMEK_GL_LIBRARIES EGL)
set(PSEMEK_PACKAGE_AS_LIBRARY OFF CACHE INTERNAL "Build applications as shared libraries")
list(APPEND PSEMEK_DEFINITIONS "-DPSEMEK_GLES=1")
list(APPEND PSEMEK_CXX_FLAGS -sUSE_SDL=2)
list(APPEND PSEMEK_CXX_FLAGS -sUSE_SDL=2 -fexperimental-library)
# by default emcc doesn't produce catch clauses, but psemek is designed around exceptions
list(APPEND PSEMEK_CXX_FLAGS -sDISABLE_EXCEPTION_CATCHING=0)
if(CMAKE_BUILD_TYPE STREQUAL Debug)

View file

@ -8,8 +8,12 @@ namespace psemek::journal
std::string current_time()
{
#ifndef __EMSCRIPTEN__
const auto now = std::chrono::system_clock::now();
return std::format("{:%FT%TZ}", now);
#else
return "";
#endif
}
}