Skip to content

Commit 632455a

Browse files
committed
Move settings of GL_ENABLE_GET_PROC_ADDRESS to sdl2.py
This also allows it to be removed from COMPILE_TIME_SETTINGS. Followup to emscripten-core#20802
1 parent 79bf3e0 commit 632455a

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

emcc.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -484,11 +484,6 @@ def phase_setup(options, state):
484484
else:
485485
settings.SUPPORT_LONGJMP = 'emscripten'
486486

487-
# SDL2 requires eglGetProcAddress() to work.
488-
# NOTE: if SDL2 is updated to not rely on eglGetProcAddress(), this can be removed
489-
if settings.USE_SDL == 2 or settings.USE_SDL_MIXER == 2 or settings.USE_SDL_GFX == 2:
490-
default_setting('GL_ENABLE_GET_PROC_ADDRESS', 1)
491-
492487

493488
@ToolchainProfiler.profile_block('compile inputs')
494489
def phase_compile_inputs(options, state, newargs):

test/test_browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@ def test_webgl_context_attributes(self):
13241324
self.btest_exit('test_webgl_context_attributes_glut.c', cflags=['--js-library', 'check_webgl_attributes_support.js', '-DAA_ACTIVATED', '-DDEPTH_ACTIVATED', '-DSTENCIL_ACTIVATED', '-DALPHA_ACTIVATED', '-lGL', '-lglut', '-lGLEW'])
13251325
self.btest_exit('test_webgl_context_attributes_sdl.c', cflags=['--js-library', 'check_webgl_attributes_support.js', '-DAA_ACTIVATED', '-DDEPTH_ACTIVATED', '-DSTENCIL_ACTIVATED', '-DALPHA_ACTIVATED', '-lGL', '-lSDL', '-lGLEW'])
13261326
if not self.is_wasm64():
1327-
self.btest_exit('test_webgl_context_attributes_sdl2.c', cflags=['--js-library', 'check_webgl_attributes_support.js', '-DAA_ACTIVATED', '-DDEPTH_ACTIVATED', '-DSTENCIL_ACTIVATED', '-DALPHA_ACTIVATED', '-lGL', '-sUSE_SDL=2', '-lGLEW', '-sGL_ENABLE_GET_PROC_ADDRESS=1'])
1327+
self.btest_exit('test_webgl_context_attributes_sdl2.c', cflags=['--js-library', 'check_webgl_attributes_support.js', '-DAA_ACTIVATED', '-DDEPTH_ACTIVATED', '-DSTENCIL_ACTIVATED', '-DALPHA_ACTIVATED', '-lGL', '-sUSE_SDL=2', '-lGLEW'])
13281328
self.btest_exit('test_webgl_context_attributes_glfw.c', cflags=['--js-library', 'check_webgl_attributes_support.js', '-DAA_ACTIVATED', '-DDEPTH_ACTIVATED', '-DSTENCIL_ACTIVATED', '-DALPHA_ACTIVATED', '-lGL', '-lglfw', '-lGLEW'])
13291329

13301330
# perform tests with attributes desactivated

tools/ports/sdl2.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ def process_dependencies(settings, cflags_only):
2626
# SDL2 includes an internal reference to Module['createContext']
2727
settings.EXPORTED_RUNTIME_METHODS.append('createContext')
2828

29+
# SDL2 requires eglGetProcAddress() to work.
30+
# NOTE: if SDL2 is updated to not rely on eglGetProcAddress(), this can be removed
31+
settings.GL_ENABLE_GET_PROC_ADDRESS = 1
32+
2933

3034
def get(ports, settings, shared):
3135
# get the port

tools/settings.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@
103103
'OPT_LEVEL',
104104
'DEBUG_LEVEL',
105105

106-
# Affects ports
107-
'GL_ENABLE_GET_PROC_ADDRESS', # NOTE: if SDL2 is updated to not rely on eglGetProcAddress(), this can be removed
108-
109106
# This is legacy setting that we happen to handle very early on
110107
'RUNTIME_LINKED_LIBS',
111108
}.union(PORTS_SETTINGS)

0 commit comments

Comments
 (0)