docs/README-emscripten.md
author Philipp Wiesemann <philipp.wiesemann@arcor.de>
Wed, 06 Jan 2016 22:39:29 +0100
changeset 10037 e2343ac4788e
parent 9782 fcf237e5e834
child 10486 5bf595c48fd4
permissions -rw-r--r--
Fixed compile warnings about uninitialized variables in test library.

Found by buildbot.
     1 Emscripten
     2 ================================================================================
     3 
     4 Build:
     5 
     6     $ mkdir build
     7     $ cd build
     8     $ emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2"
     9     $ emmake make
    10 
    11 Or with cmake:
    12 
    13     $ mkdir build
    14     $ cd build
    15     $ emcmake cmake ..
    16     $ emmake make
    17 
    18 To build one of the tests:
    19 
    20     $ cd test/
    21     $ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html
    22 
    23 Uses GLES2 renderer or software
    24 
    25 tests: https://dl.dropboxusercontent.com/u/17360362/SDL2-em/index.html
    26 
    27 Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere):
    28 
    29 SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/):
    30 
    31     $ EMCONFIGURE_JS=1 emconfigure ../configure
    32     build as usual...
    33 
    34 SDL_gfx (http://cms.ferzkopp.net/index.php/software/13-sdl-gfx):
    35 
    36     $ EMCONFIGURE_JS=1 emconfigure ../configure --disable-mmx
    37     build as usual...