Skip to content

Conversation

@jbaicoianu
Copy link

Adds ./configure --with-sdl-net option to enable networking support with Emscripten builds

AS_IF([test "x$with_sdl_net" != "xno"],[
AS_IF([test "x$with_sdl_net" = "xyes"],
[CXXFLAGS="$CXXFLAGS -s USE_SDL_NET=2"],
[LIBS="$LIBS -L$with_sdl_net/build/.libs/ -lSDL2_net"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why -L$with_sdl_net/build/.libs/? The SDL_net library provided by Emscripten should link with only -lSDL2_net when using em++ -s USE_SDL=2 -s USE_SDL_NET=2

@dreamlayers
Copy link
Owner

It should now be possible to build with SDL_net using emconfigure ./configure CFLAGS="-O3 -s USE_SDL=2 -s USE_SDL_NET=2" CXXFLAGS="-O3 -s USE_SDL=2 -s USE_SDL_NET=2". This makes the normal detection work. Note that the C compiler is used for configure tests, and the C++ compiler is used for building, so both flags need to be altered. Also note that the default -O3 would be lost if not put here. A more convenient way would be nice, but I'm not sure about this here.

I've cherry-picked df3b102. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants