Project

General

Profile

Feature #1193 » 0019-emsstetup.sh-Add.patch

S3_2 - Marko Lindqvist, 12/18/2024 05:21 PM

View differences:

Makefile.am
meson_options.txt \
platforms/appimage/build_appimages.sh \
platforms/emscripten/emsbuild.sh \
platforms/emscripten/emssetup.sh \
platforms/emscripten/setups/cross-ems.tmpl \
platforms/flatpak/build_flatpak.sh \
platforms/flatpak/org.freeciv.gtk322.yml \
platforms/emscripten/emssetup.sh
#!/bin/sh
# emssetup.sh: Setup emscripten environment for freeciv build
#
# (c) 2024 Freeciv team
#
# This script is licensed under Gnu General Public License version 2 or later.
# See COPYING available from the same location you got this script.
# https://github.com/emscripten-core/emscripten/blob/main/ChangeLog.md
EMSDK_VER=3.1.67
if test "$1" = "" || test "$1" = "-h" || test "$1" = "--help" ; then
echo "Usage: $0 <target directory>"
exit 1
fi
if test -e "$1" ; then
echo "$1 exist already!" >&2
exit 1
fi
if ! git clone https://github.com/emscripten-core/emsdk "$1" ; then
echo "Failed to clone https://github.com/emscripten-core/emsdk" >&2
exit 1
fi
if ! cd "$1" ||
! ./emsdk install "${EMSDK_VER}" ||
! ./emsdk activate "${EMSDK_VER}"
then
echo "emsdk setup failed!" >&2
exit 1
fi
scripts/ci-build.sh
;;
emsdk)
# https://github.com/emscripten-core/emscripten/blob/main/ChangeLog.md
EMSDK_VER=3.1.67
(
SRCROOT=$(pwd)
# Outside source tree
cd ..
git clone https://github.com/emscripten-core/emsdk
cd emsdk
./emsdk install "${EMSDK_VER}"
./emsdk activate "${EMSDK_VER}"
if ! ${SRCROOT}/platforms/emscripten/emssetup.sh emsdk ; then
exit 1
fi
)
EMSDKDIR="$(cd ../emsdk && pwd)"
(2-2/2)