Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Dec 30, 2022

With SDL you can choose to either include the header files via the
explictly version prefix (e.g. <SDL/SDL_audio.h> or
<SDL2/SDL_audio.h>. Or some folks configure the include path such
that the unversioned includes can be used (#include <SDL_audio.h>).

Emscripten allows the unversioned form by putting the SDL or SDL2
directory on the include path based on the USE_SDL settings, but the
fact that were defaulting to enabling version 1 was causing some issues
(See #18072 and #184402 for more details).

After this change we default to not adding either of these include
paths. This means that folks who want to use un-versioned includes will
now need to opt into one version of the other via -sUSE_SDL.

Note that folks using the explict <SDL/SDL_audio.h> includes are not
effected by this (that will always result in an SDL v1 header being
included).

In order to make it more obvious that use of <SDL_audio.h> now
requires an opt in, I created dummy headers that should give effected
users and clear error message.

We've already been doing this in STRICT module for a while now.

Fixes: #18072, #18440

@sbc100 sbc100 requested a review from kripken December 30, 2022 17:33
@sbc100 sbc100 force-pushed the no_sdl_default branch 4 times, most recently from 831ba12 to 219b097 Compare January 1, 2023 17:13
Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

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

lgtm % typo

With SDL you can choose to either include the header files via the
explictly version prefix (e.g. `<SDL/SDL_audio.h>` or
`<SDL2/SDL_audio.h>`.  Or some folks configure the include path such
that the unversioned includes can be used (`#include <SDL_audio.h>`).

Emscripten allows the unversioned form by putting the `SDL` or `SDL2`
directory on the include path based on the USE_SDL settings, but the
fact that were defaulting to enabling version 1 was causing some issues
(See #18072 and #184402 for more details).

After this change we default to not adding either of these include
paths.  This means that folks who want to use un-versioned includes will
now need to opt into one version of the other via `-sUSE_SDL`.

Note that folks using the explict `<SDL/SDL_audio.h>` includes are not
effected by this (that will always result in an SDL v1 header being
included).

In order to make it more obvious that use of `<SDL_audio.h>` now
requires an opt in, I created dummy headers that should give effected
users and clear error message.

We've already been doing this in STRICT module for a while now.

Fixes: #18072, #18440
@sbc100 sbc100 enabled auto-merge (squash) January 3, 2023 18:38
@sbc100 sbc100 merged commit d75c1d6 into main Jan 3, 2023
@sbc100 sbc100 deleted the no_sdl_default branch January 3, 2023 20:00
sbc100 added a commit that referenced this pull request Jul 31, 2023
This changes the default behaviour to match that of STRICT mode
and MINIMAL_RUNTIME node.

We made a similar change for USE_SDL back in #18443.

As part of this change I also updated the code that maps `-l` flags
to JS libraries.  In some cases we also want these to set the
corresponding `-sUSE_XXX` setting.
sbc100 added a commit that referenced this pull request Aug 1, 2023
This changes the default behaviour to match that of STRICT mode
and MINIMAL_RUNTIME node.

We made a similar change for USE_SDL back in #18443.

As part of this change I also updated the code that maps `-l` flags
to JS libraries.  In some cases we also want these to set the
corresponding `-sUSE_XXX` setting.
sbc100 added a commit that referenced this pull request Aug 25, 2023
This changes the default behaviour to match that of STRICT mode
and MINIMAL_RUNTIME node.

We made a similar change for USE_SDL back in #18443.

As part of this change I also updated the code that maps `-l` flags
to JS libraries.  In some cases we also want these to set the
corresponding `-sUSE_XXX` setting.
sbc100 added a commit that referenced this pull request Aug 25, 2023
This changes the default behaviour to match that of STRICT mode
and MINIMAL_RUNTIME node.

We made a similar change for USE_SDL back in #18443.

As part of this change I also updated the code that maps `-l` flags
to JS libraries.  In some cases we also want these to set the
corresponding `-sUSE_XXX` setting.
sbc100 added a commit that referenced this pull request Aug 25, 2023
This changes the default behaviour to match that of STRICT mode
and MINIMAL_RUNTIME node.

We made a similar change for USE_SDL back in #18443.

As part of this change I also updated the code that maps `-l` flags
to JS libraries.  In some cases we also want these to set the
corresponding `-sUSE_XXX` setting.
sbc100 added a commit that referenced this pull request Aug 25, 2023
This changes the default behaviour to match that of STRICT mode
and MINIMAL_RUNTIME node.

We made a similar change for USE_SDL back in #18443.

As part of this change I also updated the code that maps `-l` flags
to JS libraries.  In some cases we also want these to set the
corresponding `-sUSE_XXX` setting.
sbc100 added a commit that referenced this pull request Aug 29, 2023
This changes the default behaviour to match that of STRICT mode
and MINIMAL_RUNTIME node.

We made a similar change for USE_SDL back in #18443.

As part of this change I also updated the code that maps `-l` flags
to JS libraries.  In some cases we also want these to set the
corresponding `-sUSE_XXX` setting.
sbc100 added a commit that referenced this pull request Aug 29, 2023
This changes the default behaviour to match that of STRICT mode
and MINIMAL_RUNTIME node.

We made a similar change for USE_SDL back in #18443.

As part of this change I also updated the code that maps `-l` flags
to JS libraries.  In some cases we also want these to set the
corresponding `-sUSE_XXX` setting.
sbc100 added a commit that referenced this pull request Aug 29, 2023
This changes the default behaviour to match that of STRICT mode
and MINIMAL_RUNTIME node.

We made a similar change for USE_SDL back in #18443.

As part of this change I also updated the code that maps `-l` flags
to JS libraries.  In some cases we also want these to set the
corresponding `-sUSE_XXX` setting.
sbc100 added a commit that referenced this pull request Aug 29, 2023
This changes the default behaviour to match that of STRICT mode
and MINIMAL_RUNTIME node.

We made a similar change for USE_SDL back in #18443.

As part of this change I also updated the code that maps `-l` flags
to JS libraries.  In some cases we also want these to set the
corresponding `-sUSE_XXX` setting.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Aug 11, 2025
This removes the python dependency and the need to .bat and shell
launchers.

These script have always be shell scripts upstream and there should be
no expectation that they can be run on windows.

See libsdl-org/SDL#3516

In addition fix `sdl-config.py` so that it explicitly includes
`-sUSE_SDL`. This has been required since emscripten-core#18443.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Aug 11, 2025
This removes the python dependency and the need to .bat and shell
launchers.

These script have always be shell scripts upstream and there should be
no expectation that they can be run on windows.

See libsdl-org/SDL#3516

In addition fix `sdl-config.py` so that it explicitly includes
`-sUSE_SDL`. This has been required since emscripten-core#18443.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Aug 11, 2025
This removes the python dependency and the need to .bat and shell
launchers.

These script have always be shell scripts upstream and there should be
no expectation that they can be run on windows.

See libsdl-org/SDL#3516

In addition fix `sdl-config.py` so that it explicitly includes
`-sUSE_SDL`. This has been required since emscripten-core#18443.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Aug 11, 2025
This removes the python dependency and the need to .bat and shell
launchers.

These script have always be shell scripts upstream and there should be
no expectation that they can be run on windows.

See libsdl-org/SDL#3516

In addition fix `sdl-config.py` so that it explicitly includes
`-sUSE_SDL`. This has been required since emscripten-core#18443.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Aug 11, 2025
This removes the python dependency and the need to .bat and shell
launchers.

These script have always be shell scripts upstream and there should be
no expectation that they can be run on windows.

See libsdl-org/SDL#3516

In addition fix `sdl-config.py` so that it explicitly includes
`-sUSE_SDL`. This has been required since emscripten-core#18443.
sbc100 added a commit that referenced this pull request Aug 11, 2025
This removes the python dependency and the need to .bat and shell
launchers.

These script have always be shell scripts upstream and there should be
no expectation that they can be run on windows.

See libsdl-org/SDL#3516

In addition fix `sdl-config.py` so that it explicitly includes
`-sUSE_SDL`. This has been required since #18443.
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.

Disable SDL2 by default

3 participants