You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
USE_SDL is 1 by default
Everything is fine except for building SDL2
When USE_SDL=1, emcc will add an include path of its built-in SDL1, which contains same files with SDL2 (e.g. SDL_config.h)
Building SDL2 without additional flags will result in redefination errors
How to disable USE_SDL globally? Is there any configuration file or environment variable? Please don't tell me to use CFLAGS= because of many compability issues of many build systems
If you really don't want to pass -sUSE_SDL=0 on the command line you could edit src/settings.js and change the default for USE_SDL from 1 to 0... we don't normally recommend editing this file, but its one option.
If you really don't want to pass -sUSE_SDL=0 on the command line you could edit src/settings.js and change the default for USE_SDL from 1 to 0... we don't normally recommend editing this file, but its one option.
True perhaps the default should be changed 0. On the other hand doesn't this only effect folks who what to buiild an out-of-tree copy of SDL2. I wonder how common that is?
Common enough to have been noticed by at least two people here. Building your own SDL isn't that crazy when you build for multiple platforms and want precise and centralized control over your dependencies. We do that in Taisei; I wrote meson build definitions for all of our deps and we use the same set of subprojects for official emscripten, windows, macos, and linux builds. Building a custom SDL also allows us to disable a bunch of dead code that our game is not using, such as the built-in 2D renderer.
Activity
sbc100 commentedon Oct 19, 2022
If you don't want the system version of SDL you can use
-sUSE_SDL=0sbc100 commentedon Oct 19, 2022
Is there some reason the emscripten builtin SDL2 port doesn't work for you? (i.e.
-sUSE_SDL=2)?sbc100 commentedon Oct 19, 2022
If you really don't want to pass
-sUSE_SDL=0on the command line you could editsrc/settings.jsand change the default forUSE_SDLfrom 1 to 0... we don't normally recommend editing this file, but its one option.aleck099 commentedon Oct 20, 2022
Finally I edited
settings.jsAkaricchi commentedon Nov 7, 2022
I think
USE_SDL=1is a bad default. SDL1 has been obsolete for years. How much maintained software even still depends on it?sbc100 commentedon Nov 7, 2022
True perhaps the default should be changed 0. On the other hand doesn't this only effect folks who what to buiild an out-of-tree copy of SDL2. I wonder how common that is?
meson: explicitly set -sUSE_SDL=0 for Emscripten builds
Akaricchi commentedon Nov 7, 2022
Common enough to have been noticed by at least two people here. Building your own SDL isn't that crazy when you build for multiple platforms and want precise and centralized control over your dependencies. We do that in Taisei; I wrote meson build definitions for all of our deps and we use the same set of subprojects for official emscripten, windows, macos, and linux builds. Building a custom SDL also allows us to disable a bunch of dead code that our game is not using, such as the built-in 2D renderer.
sbc100 commentedon Nov 27, 2022
Re-opening because there is some ongoing discussion about whether its a good idea to make
USE_SDLdefault to 0 instead of 1.Akaricchi commentedon Nov 28, 2022
FWIW, SDL3 is now under development, so even SDL2 will be on its way out fairly soon (hopefully more gracefully than SDL1 was).
Don't default to SDLv1 for un-versioned SDL includes
Don't default to SDLv1 for un-versioned SDL includes
Don't default to SDLv1 for un-versioned SDL includes
Don't default to SDLv1 for un-versioned SDL includes
Don't default to SDLv1 for un-versioned SDL includes
Don't default to SDLv1 for un-versioned SDL includes
Don't default to SDLv1 for un-versioned SDL includes
Don't default to SDLv1 for un-versioned SDL includes (#18443)