Skip to content

Commit

Permalink
Added packaging scripts for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel committed Jul 25, 2019
1 parent 8b3b471 commit fe868c7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
12 changes: 9 additions & 3 deletions neo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,15 @@ set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-DNDEBUG ${CMAKE_C_FLAGS_MINSIZEREL}")

if (EMSCRIPTEN)
add_custom_target(package_demo_data ${CMAKE_SOURCE_DIR}/sys/wasm/package_demo_data.sh data/demo)
add_custom_target(package_full_data ${CMAKE_SOURCE_DIR}/sys/wasm/package_full_data.sh data/base)
add_custom_target(package_chunked_demo_data ${CMAKE_SOURCE_DIR}/sys/wasm/package_chunked_demo_data.sh data/chunked)
if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
add_custom_target(package_demo_data ${CMAKE_SOURCE_DIR}/sys/wasm/package_demo_data.bat data/demo)
add_custom_target(package_full_data ${CMAKE_SOURCE_DIR}/sys/wasm/package_full_data.bat data/base)
add_custom_target(package_chunked_demo_data ${CMAKE_SOURCE_DIR}/sys/wasm/package_chunked_demo_data.bat data/chunked)
else()
add_custom_target(package_demo_data ${CMAKE_SOURCE_DIR}/sys/wasm/package_demo_data.sh data/demo)
add_custom_target(package_full_data ${CMAKE_SOURCE_DIR}/sys/wasm/package_full_data.sh data/base)
add_custom_target(package_chunked_demo_data ${CMAKE_SOURCE_DIR}/sys/wasm/package_chunked_demo_data.sh data/chunked)
endif()

# demo data preload
set(ldflags "${ldflags} --pre-js ../neo/sys/wasm/pre.js")
Expand Down
3 changes: 3 additions & 0 deletions neo/sys/wasm/package_chunked_demo_data.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
python %EMSDK%/upstream/emscripten/tools/file_packager.py demo_bootstrap.data --preload %1/demo_bootstrap.pk4@/usr/local/share/d3wasm/base/demo_bootstrap.pk4 --js-output=demo_bootstrap.js --use-preload-cache --no-heap-copy
python %EMSDK%/upstream/emscripten/tools/file_packager.py demo_game00.data --preload %1/demo_game00.pk4@/usr/local/share/d3wasm/base/demo_game00.pk4 --js-output=demo_game00.js --use-preload-cache --no-heap-copy
python %EMSDK%/upstream/emscripten/tools/file_packager.py demo_game01.data --preload %1/demo_game01.pk4@/usr/local/share/d3wasm/base/demo_game01.pk4 --js-output=demo_game01.js --use-preload-cache --no-heap-copy
1 change: 1 addition & 0 deletions neo/sys/wasm/package_demo_data.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python %EMSDK%/upstream/emscripten/tools/file_packager.py demo00.data --preload %1/demo00.pk4@/usr/local/share/d3wasm/base/demo00.pk4 --js-output=demo00.js --use-preload-cache --no-heap-copy

0 comments on commit fe868c7

Please sign in to comment.