Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
Test I guess
Browse files Browse the repository at this point in the history
  • Loading branch information
OFFTKP committed Jan 10, 2024
1 parent 06e2ce1 commit 4c4440a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/Web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ jobs:
actions-cache-folder: 'emsdk-cache'
- name: Build
run: |
export EMCC_FORCE_STDLIBS=libc++,libc++abi
emcmake cmake -B build
cmake --build build --config Release
cmake --build build
mv data/hydra.ico build/favicon.ico
mv build/hydra.html build/index.html
- name: Deploy
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ elseif(HYDRA_WEB)
set(CMAKE_CXX_FLAGS "-fPIC")
set(LONG_INT 8) # for openssl
set(CMAKE_EXECUTABLE_SUFFIX ".html")
set_target_properties(hydra PROPERTIES LINK_FLAGS "-sASSERTIONS -sEXPORTED_FUNCTIONS=[_malloc,_free,_main,_main_impl] -sEXPORTED_RUNTIME_METHODS=ccall -sNO_DISABLE_EXCEPTION_CATCHING -sALLOW_MEMORY_GROWTH -sTOTAL_MEMORY=192MB -lidbfs.js -s ELIMINATE_DUPLICATE_FUNCTIONS=1 --shell-file ${PROJECT_SOURCE_DIR}/data/shell.html -flto -sMAIN_MODULE=1 -sUSE_CLOSURE_COMPILER=0 --closure 0")
set_target_properties(hydra PROPERTIES LINK_FLAGS "-sASSERTIONS -sEXPORT_ALL -sEXPORTED_FUNCTIONS=@${CMAKE_CURRENT_SOURCE_DIR}/exported.json -sEXPORTED_RUNTIME_METHODS=ccall -sNO_DISABLE_EXCEPTION_CATCHING -sALLOW_MEMORY_GROWTH -sTOTAL_MEMORY=192MB -lidbfs.js -s ELIMINATE_DUPLICATE_FUNCTIONS=1 --shell-file ${PROJECT_SOURCE_DIR}/data/shell.html -flto -sMAIN_MODULE=1 -sUSE_CLOSURE_COMPILER=0 --closure 0")
else()
message(FATAL_ERROR "Unsupported platform")
endif()
Expand Down
6 changes: 6 additions & 0 deletions exported.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
"_malloc",
"_free",
"_main",
"_main_impl"
]
4 changes: 3 additions & 1 deletion src/app.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,17 @@ extern "C" void hydra_drop_file(const char* name, void* data, size_t size)
std::filesystem::path out_path = cores / file;
std::ofstream ofs(out_path, std::ios_base::binary | std::ios_base::out);
ofs.write((const char*)data, size);
sync_fs();
Settings::ReinitCoreInfo();
}
else
{
std::filesystem::path cache = Settings::GetCachePath();
std::filesystem::path out_path = cache / file;
std::ofstream ofs(out_path, std::ios_base::binary | std::ios_base::out);
ofs.write((const char*)data, size);
sync_fs();
}
sync_fs();
}

#ifdef HYDRA_WEB
Expand Down

0 comments on commit 4c4440a

Please sign in to comment.