Feature #2280 ยป 0086-Meson-Add-preload-for-emscripten-client.patch
| meson.build | ||
|---|---|---|
|
zlib_dep = []
|
||
|
syslua = 'false'
|
||
|
ems_suffix = 'html'
|
||
|
ems_largs = [ '--preload-file', 'data' ]
|
||
|
priv_conf_data.set('ALWAYS_ROOT', 1)
|
||
| ... | ... | |
|
endif
|
||
|
ems_suffix = []
|
||
|
ems_largs = []
|
||
|
endif
|
||
|
# Set unconditionally, as it was checked as hard requirement
|
||
| ... | ... | |
|
tinycthr_files = files()
|
||
|
endif
|
||
|
if host_system == 'emscripten'
|
||
|
ems_data = custom_target('datacopy', output: 'data',
|
||
|
command: [sh_exe, files('platforms/emscripten/datacopy.sh')],
|
||
|
depend_files: files('platforms/emscripten/datacopy.sh'))
|
||
|
else
|
||
|
ems_data = []
|
||
|
endif
|
||
|
if syslua != 'false' and lua_dep_tmp.found()
|
||
|
lua_dep = lua_dep_tmp
|
||
|
fc_lua = []
|
||
| ... | ... | |
|
sdl2_gfx_src,
|
||
|
clienticon,
|
||
|
c_args: sdl2_gfx_cargs,
|
||
|
sources: [verhdr],
|
||
|
sources: [verhdr, ems_data],
|
||
|
include_directories: [client_inc, sdl2_gfx_inc ],
|
||
|
dependencies: [sdl2main_dep, audio_dep,
|
||
|
sdl2_image_dep, sdl2_gfx_dep, sdl2_ttf_dep,
|
||
|
net_dep, gettext_dep, mw_extra_dep],
|
||
|
link_with: client_common,
|
||
|
link_args: ems_largs,
|
||
|
name_suffix: ems_suffix,
|
||
|
install: true,
|
||
|
win_subsystem: 'windows'
|
||
| ... | ... | |
|
'client/gui-sdl3/wldlg.c',
|
||
|
'client/gui-sdl3/SDL3_gfx/SDL3_rotozoom.c',
|
||
|
clienticon,
|
||
|
sources: [verhdr],
|
||
|
sources: [verhdr, ems_data],
|
||
|
include_directories: [client_inc, sdl3_gfx_inc ],
|
||
|
dependencies: [sdl3main_dep, audio_dep,
|
||
|
sdl3_image_dep, sdl3_gfx_dep, sdl3_ttf_dep,
|
||
|
net_dep, gettext_dep, mw_extra_dep],
|
||
|
link_with: client_common,
|
||
|
link_args: ems_largs,
|
||
|
name_suffix: ems_suffix,
|
||
|
install: true,
|
||
|
win_subsystem: 'windows'
|
||
| platforms/Makefile.am | ||
|---|---|---|
|
appimage/build_appimages.sh \
|
||
|
emscripten/emsbuild.sh \
|
||
|
emscripten/emssetup.sh \
|
||
|
emscripten/datacopy.sh \
|
||
|
emscripten/setups/cross-ems.tmpl \
|
||
|
flatpak/build_flatpaks.sh \
|
||
|
flatpak/org.freeciv.gtk322.yml \
|
||
| platforms/emscripten/datacopy.sh | ||
|---|---|---|
|
#!/bin/sh
|
||
|
# datacopy.sh: Copy data to emscripten build directory
|
||
|
#
|
||
|
# (c) 2026 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.
|
||
|
DATA_SRC="$(cd "$(dirname "$0")/../../" || exit 1 ; pwd)"
|
||
|
DATA_TGT="$(pwd)"
|
||
|
if ! mkdir -p "${DATA_TGT}/data/themes" ; then
|
||
|
echo "Failed to create data directories!" >&2
|
||
|
exit 1
|
||
|
fi
|
||
|
if ! cp "${DATA_SRC}/data/helpdata.txt" "${DATA_TGT}/data/" ||
|
||
|
! cp -R "${DATA_SRC}/data/themes/gui-sdl2" "${DATA_TGT}/data/themes/"
|
||
|
then
|
||
|
echo "Copying data failed!" >&2
|
||
|
exit 1
|
||
|
fi
|
||