From 1195bd26d5d5e8cc1fcf1e90714c3ffd703ebf4e Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sun, 5 Jul 2026 18:38:47 +0300 Subject: [PATCH] Change resources path in web builds --- libs/sdl2/source/main.cpp | 4 ++-- package/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/sdl2/source/main.cpp b/libs/sdl2/source/main.cpp index 41d6ccfd..65857f99 100644 --- a/libs/sdl2/source/main.cpp +++ b/libs/sdl2/source/main.cpp @@ -52,9 +52,9 @@ int main(int argc, char ** argv) try log::register_thread("main"); #ifdef __EMSCRIPTEN__ - // In web builds, resources are in the root of + // In web builds, resources are stored in // the Emscripten virtual filesystem - app::set_resource_root("/"); + app::set_resource_root("/resources"); #endif auto const factory = app::make_application_factory(); diff --git a/package/CMakeLists.txt b/package/CMakeLists.txt index 2970af0f..cbb1bd1a 100644 --- a/package/CMakeLists.txt +++ b/package/CMakeLists.txt @@ -218,7 +218,7 @@ function(psemek_package_files target) elseif(PSEMEK_PLATFORM_WEB) foreach(_FILE IN LISTS ARGN) target_link_options(${target} PRIVATE - "--preload-file=${CMAKE_CURRENT_LIST_DIR}/${_FILE}@/${_FILE}" + "--preload-file=${CMAKE_CURRENT_LIST_DIR}/${_FILE}@/resources/${_FILE}" ) endforeach() else()