[flutter] Include spine-cpp sources in package

This commit is contained in:
Mario Zechner 2022-11-21 21:29:48 +01:00
parent 5d4141c62e
commit 86ecf4927f
4 changed files with 12 additions and 6 deletions

View File

@ -1 +1,4 @@
example/
example/
!src/spine-cpp
!ios/Classes/spine-cpp
!macos/Classes/spine-cpp

View File

@ -1,13 +1,13 @@
#!/bin/sh
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
pushd $dir > /dev/null
mkdir -p ../lib/assets/
mkdir -p lib/assets/
# Need to use -O2, as -O3 applies the Closure compiler to native function names.
# The entries for exported functions in Module.asm will be scrambled so
# EmscriptenModule._fromJs() is unable to parse them and link them with original
# names set on the module, e.g. Module._spine_get_major_version.
emcc \
-Ispine-cpp/include \
-Isrc/spine-cpp/include \
-O2 --closure 1 -fno-rtti -fno-exceptions -lc++abi -lc++ \
-s STRICT=1 \
-s LLD_REPORT_UNDEFINED \
@ -19,7 +19,7 @@ emcc \
-s EXPORTED_FUNCTIONS='["_malloc", "_free"]' \
--no-entry \
-s EXPORT_NAME=libspine_flutter \
spine_flutter.cpp `find spine-cpp/src -type f` \
-o ../lib/assets/libspine_flutter.js
ls -lah ../lib/assets
src/spine_flutter.cpp `find src/spine-cpp/src -type f` \
-o lib/assets/libspine_flutter.js
ls -lah lib/assets
popd

View File

@ -3,6 +3,8 @@ description: The official Spine Flutter Runtime to load, display and interact wi
version: 0.0.1
homepage: https://esotericsoftware.com
repository: https://github.com/esotericsoftware/spine-runtimes
issue_tracker: https://github.com/esotericsoftware/spine-runtimes/issues
documentation: https://esotericsoftware.com/spine-flutter
environment:
sdk: ">=2.17.6 <3.0.0"
@ -38,6 +40,7 @@ flutter:
ffiPlugin: true
windows:
ffiPlugin: true
web:
assets:
- lib/assets/libspine_flutter.js