|
|
@ -8,29 +8,31 @@ CURR_DIR="${PWD}"
|
|
|
|
|
|
|
|
|
|
|
|
BUILD_TYPE="$1"
|
|
|
|
BUILD_TYPE="$1"
|
|
|
|
if [ -z "$BUILD_TYPE" ]; then
|
|
|
|
if [ -z "$BUILD_TYPE" ]; then
|
|
|
|
BUILD_TYPE=Release
|
|
|
|
BUILD_TYPE=Release
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
mkdir -p build/wasm
|
|
|
|
# CI: already had emsdk installed.
|
|
|
|
if [ ! -d ../../build/emsdk ]; then
|
|
|
|
if ! command -v emcc; then
|
|
|
|
git clone https://github.com/emscripten-core/emsdk.git ../../build/emsdk
|
|
|
|
if [ ! -d ../../build/emsdk ]; then
|
|
|
|
|
|
|
|
git clone https://github.com/emscripten-core/emsdk.git ../../build/emsdk
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pushd ../../build/emsdk
|
|
|
|
|
|
|
|
./emsdk install 3.0.0
|
|
|
|
|
|
|
|
./emsdk activate 3.0.0
|
|
|
|
|
|
|
|
source ./emsdk_env.sh
|
|
|
|
|
|
|
|
popd # ../../build/emsdk
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
pushd ../../build/emsdk
|
|
|
|
mkdir -p build/wasm
|
|
|
|
#git pull
|
|
|
|
|
|
|
|
./emsdk install 3.0.0
|
|
|
|
|
|
|
|
./emsdk activate 3.0.0
|
|
|
|
|
|
|
|
source ./emsdk_env.sh
|
|
|
|
|
|
|
|
popd # ../../build/emsdk
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pushd build/wasm
|
|
|
|
pushd build/wasm
|
|
|
|
emcmake cmake -DCMAKE_BUILD_TYPE="$BUILD_TYPE" ../..
|
|
|
|
emcmake cmake -DCMAKE_BUILD_TYPE="$BUILD_TYPE" ../..
|
|
|
|
make -j
|
|
|
|
make -j
|
|
|
|
TARGET_FILES="
|
|
|
|
TARGET_FILES="
|
|
|
|
KgmLegacy.js
|
|
|
|
KgmLegacy.js
|
|
|
|
KgmWasm.js
|
|
|
|
KgmWasm.js
|
|
|
|
KgmWasm.wasm
|
|
|
|
KgmWasm.wasm
|
|
|
|
KgmWasmBundle.js
|
|
|
|
KgmWasmBundle.js
|
|
|
|
"
|
|
|
|
"
|
|
|
|
|
|
|
|
|
|
|
|
cp $TARGET_FILES "${CURR_DIR}/"
|
|
|
|
cp $TARGET_FILES "${CURR_DIR}/"
|
|
|
|