Some flags are not passed to Emscripten when merging. I'm attempting to merge several files in a project that uses the SDL library, but I'm unable to properly link the library because the "-sUSE_SDL=2" flag is not being passed to emscripten.
$ cilly --merge ../asteroids/*.c --gcc=emcc --out=merge.c -sUSE_SDL=2
Warning: Unknown argument -sUSE_SDL=2
In file included from ../asteroids/main.c:5:
/usr/lib/emsdk/upstream/emscripten/cache/sysroot/include/fakesdl/SDL.h:1:2: error: "To use the emscripten port of SDL use -sUSE_SDL or -sUSE_SDL=2"
#error "To use the emscripten port of SDL use -sUSE_SDL or -sUSE_SDL=2"
^
1 error generated.
emcc: error: '/usr/lib/emsdk/upstream/bin/clang -target wasm32-unknown-emscripten -fignore-exceptions -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -DEMSCRIPTEN -Werror=implicit-function-declaration --sysroot=/usr/lib/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/fakesdl -Xclang -iwithsysroot/include/compat -D_GNUCC -E -DCIL=1 ../asteroids/main.c -o /tmp/cil-V2UzF6Fu.i' failed (returned 1)
Clearly (_#error "To use the emscripten port of SDL use -sUSE_SDL or -sUSESDL=2"), the -sUSE_SDL=2 flag is not being passed to emscripten. This is confirmed with verbose output:
Description
Some flags are not passed to Emscripten when merging. I'm attempting to merge several files in a project that uses the SDL library, but I'm unable to properly link the library because the "-sUSE_SDL=2" flag is not being passed to emscripten.
Steps to reproduce
(https://github.com/robertaboukhalil/wasm-asteroids)
Clearly (_#error "To use the emscripten port of SDL use -sUSE_SDL or -sUSESDL=2"), the -sUSE_SDL=2 flag is not being passed to emscripten. This is confirmed with verbose output:
Expected result
The emcc command:
Should be: