Project

General

Profile

Task #774803

Emscripten clients for web.

Added by Zoltán Žarkov almost 2 years ago. Updated 2 months ago.

Status:
New
Priority:
Normal
Category:
-
Target version:
-
Start date:
Due date:
% Done:

67%

Estimated time:
(Total: 0.00 h)

Description

This is the megaticket for emscripten work. I've attached the first build of something that crashes on the home screen.

fc-sdl2.zip.partab (20 MB) fc-sdl2.zip.partab Zoltán Žarkov, 2018-09-19 09:38 PM
fc-sdl2.zip.partaa (20 MB) fc-sdl2.zip.partaa Zoltán Žarkov, 2018-09-19 09:38 PM
fc-sdl2.zip.partad (20 MB) fc-sdl2.zip.partad Zoltán Žarkov, 2018-09-19 09:38 PM
fc-sdl2.zip.partac (20 MB) fc-sdl2.zip.partac Zoltán Žarkov, 2018-09-19 09:38 PM
fc-sdl2.zip.partaf (1000 KB) fc-sdl2.zip.partaf Zoltán Žarkov, 2018-09-19 09:39 PM
fc-sdl2.zip.partae (20 MB) fc-sdl2.zip.partae Zoltán Žarkov, 2018-09-19 09:39 PM
emscripten.diff (6.09 KB) emscripten.diff Zoltán Žarkov, 2018-09-19 09:53 PM
0001-Add-ICU-and-SDL2_gfx-ports.patch (3.81 KB) 0001-Add-ICU-and-SDL2_gfx-ports.patch Zoltán Žarkov, 2018-09-20 06:00 PM

Subtasks

Bug #775057: Function pointer casts not compatible with EmscriptenClosedMarko Lindqvist

Bug #829535: Multiple declarations of pOptions_ButtonClosedMarko Lindqvist

Feature #838867: Add SDL2 Emscripten client to autotools buildNew

Feature #871637: emscripten: Disable SDL2 configure checksClosedMarko Lindqvist

Feature #839110: Add Qt Emscripten client to autotools buildNew

Feature #873419: Consolidate Qt configure flagsIn ProgressMarko Lindqvist

Feature #846914: Remove nested Qt event loopsClosedMarko Lindqvist

Feature #871624: Adapt networking for Emscripten clientsNew

History

#1 Updated by Zoltán Žarkov almost 2 years ago

Here's the patch of the changes I had to make.

#2 Updated by Zoltán Žarkov almost 2 years ago

Check out emscripten from head, apply this patch, and set PATH accordingly. Freeciv then builds:
emconfigure ./configure CFLAGS="-s USE_SDL=2 -s USE_SDL_TTF=2 -s USE_ICU=1 -s USE_SDL_IMAGE=2 -s USE_SDL_GFX=2 -s USE_ZLIB=1" LDFLAGS="-s USE_ZLIB=1 -s USE_SDL=2 -s USE_SDL_TTF=2 -s USE_ICU=1 -s USE_SDL_IMAGE=2 -s USE_SDL_GFX=2" --disable-fcdb --disable-server --disable-ipv6 --enable-client=sdl2 --disable-sdl-mixer --disable-fcmp && emmake make

#3 Updated by Zoltán Žarkov almost 2 years ago

After building, you need to add some flags to the emcc command that produces the final html output. cd client and:
/bin/sh ../libtool --tag=CC --preserve-dup-deps --mode=link emcc -Wno-tautological-compare -Wall -Wpointer-arith -Wcast-align -s USE_SDL=2 -s USE_SDL_TTF=2 -s USE_ICU=1 -s USE_SDL_IMAGE=2 -s USE_SDL_GFX=2 -s USE_ZLIB=1 -s USE_ZLIB=1 -s USE_SDL=2 -s USE_SDL_TTF=2 -s USE_ICU=1 -s USE_SDL_IMAGE=2 -s USE_SDL_GFX=2 -s SDL2_IMAGE_FORMATS='["png"]' -s ALLOW_MEMORY_GROWTH=1 --preload-file ../data@data -o freeciv-sdl2.html dummy.o libfcgui-sdl2.la ../common/libfreeciv.la -lm -lnls -pthread

emrun client/freeciv-sdl2.html will give you the friendly frozen home screen with a bunch of errors in the js console.

#4 Updated by Zoltán Žarkov 9 months ago

  • Subject changed from Emscripten SDL2 client for web. to Emscripten clients for web.

This is now for Qt and SDL2 Emscripten.

Also available in: Atom PDF