mirror of
https://github.com/fallout2-ce/fallout2-ce.git
synced 2026-07-27 16:47:11 -07:00
emscripten: optimize fs sync; add source map output
This commit is contained in:
@@ -382,6 +382,7 @@ else()
|
||||
target_link_options( ${EXECUTABLE_NAME} PRIVATE "-sEXPORTED_RUNTIME_METHODS=callMain,addRunDependency,removeRunDependency" )
|
||||
target_link_options( ${EXECUTABLE_NAME} PRIVATE "-sEXPORT_ALL" )
|
||||
target_link_options( ${EXECUTABLE_NAME} PRIVATE "-sEXPORT_NAME=fallout2ce" )
|
||||
target_link_options( ${EXECUTABLE_NAME} PRIVATE "-gsource-map" )
|
||||
endif()
|
||||
|
||||
target_link_libraries(${EXECUTABLE_NAME} ${ZLIB_LIBRARIES})
|
||||
|
||||
@@ -4,8 +4,10 @@ set( CMAKE_C_COMPILER "emcc" )
|
||||
set( CMAKE_CXX_COMPILER "em++" )
|
||||
set( CMAKE_C_FLAGS "--use-port=sdl2 \
|
||||
--use-port=sdl2_mixer \
|
||||
--use-port=zlib" )
|
||||
--use-port=zlib \
|
||||
-gsource-map" )
|
||||
set( CMAKE_CXX_FLAGS "--use-port=sdl2 \
|
||||
--use-port=sdl2_mixer \
|
||||
--use-port=zlib" )
|
||||
--use-port=zlib \
|
||||
-gsource-map" )
|
||||
set( EXECUTABLE_NAME fallout2-ce.js )
|
||||
+4
-6
@@ -68,12 +68,10 @@ int xfileClose(XFile* stream)
|
||||
EM_ASM(
|
||||
// clang-format off
|
||||
// The following code is not C++ code, but JavaScript code.
|
||||
const handle = setInterval(() => {
|
||||
if (FS.syncFSRequests === 0) {
|
||||
clearInterval(handle);
|
||||
FS.syncfs(err => err && console.warn(`FS.syncfs() error: ${err}`, err));
|
||||
}
|
||||
}, 0);
|
||||
setTimeout(() => {
|
||||
if (FS.syncFSRequests !== 0) return;
|
||||
FS.syncfs(err => err && console.warn(`FS.syncfs() error: ${err}`, err));
|
||||
}, 0)
|
||||
// clang-format on
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user