Skip to content

Commit 978e102

Browse files
authored
Always include library_sdl.js and library_glfw.js conditionally (#19057)
Split out from #19028.
1 parent 3cf83fd commit 978e102

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

emcc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,6 +1993,7 @@ def phase_linker_setup(options, state, newargs):
19931993
default_setting('AUTO_JS_LIBRARIES', 0)
19941994
# When using MINIMAL_RUNTIME, symbols should only be exported if requested.
19951995
default_setting('EXPORT_KEEPALIVE', 0)
1996+
default_setting('USE_GLFW', 0)
19961997

19971998
if settings.STRICT_JS and (settings.MODULARIZE or settings.EXPORT_ES6):
19981999
exit_with_error("STRICT_JS doesn't work with MODULARIZE or EXPORT_ES6")

src/modules.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ global.LibraryManager = {
113113
'library_webgl.js',
114114
'library_html5_webgl.js',
115115
'library_openal.js',
116-
'library_sdl.js',
117116
'library_glut.js',
118117
'library_xlib.js',
119118
'library_egl.js',
@@ -122,8 +121,8 @@ global.LibraryManager = {
122121
'library_idbstore.js',
123122
'library_async.js',
124123
]);
125-
if (USE_GLFW) {
126-
libraries.push('library_glfw.js');
124+
if (USE_SDL != 2) {
125+
libraries.push('library_sdl.js');
127126
}
128127
} else {
129128
if (ASYNCIFY) {
@@ -137,6 +136,10 @@ global.LibraryManager = {
137136
}
138137
}
139138

139+
if (USE_GLFW) {
140+
libraries.push('library_glfw.js');
141+
}
142+
140143
if (LZ4) {
141144
libraries.push('library_lz4.js');
142145
}

src/settings.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,7 @@ var EMSCRIPTEN_TRACING = false;
12921292
// Specify the GLFW version that is being linked against. Only relevant, if you
12931293
// are linking against the GLFW library. Valid options are 2 for GLFW2 and 3
12941294
// for GLFW3.
1295+
// In MINIMAL_RUNTIME builds, this option defaults to 0.
12951296
// [link]
12961297
var USE_GLFW = 2;
12971298

src/shell.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ var /** @type {{
2727
noAudioDecoding: boolean,
2828
noWasmDecoding: boolean,
2929
canvas: HTMLCanvasElement,
30+
ctx: Object,
3031
dataFileDownloads: Object,
3132
preloadResults: Object,
3233
useWebGL: boolean,

tools/gen_sig_info.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ def extract_sig_info(sig_info, extra_settings=None, extra_cflags=None):
221221
'USE_PTHREADS': 1,
222222
'STACK_OVERFLOW_CHECK': 1,
223223
'FULL_ES3': 1,
224+
'USE_SDL': 1,
224225
# Currently GLFW symbols have different sigs for the same symbol because the
225226
# signatures changed between v2 and v3, so for now we continue to maintain
226227
# them by hand.

0 commit comments

Comments
 (0)