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