Skip to content

Commit c328cc4

Browse files
committed
Always include library_sdl.js and library_glfw.js conditionally
Split out from #19028.
1 parent b116323 commit c328cc4

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
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: 8 additions & 7 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,21 +121,23 @@ global.LibraryManager = {
122121
'library_idbstore.js',
123122
'library_async.js',
124123
]);
125-
if (USE_GLFW) {
126-
libraries.push('library_glfw.js');
127-
}
128124
} else {
129125
if (ASYNCIFY) {
130126
libraries.push('library_async.js');
131127
}
132-
if (USE_SDL == 1) {
133-
libraries.push('library_sdl.js');
134-
}
135128
if (USE_SDL == 2) {
136129
libraries.push('library_egl.js', 'library_webgl.js', 'library_html5_webgl.js');
137130
}
138131
}
139132

133+
if (USE_SDL == 1) {
134+
libraries.push('library_sdl.js')
135+
}
136+
137+
if (USE_GLFW) {
138+
libraries.push('library_glfw.js');
139+
}
140+
140141
if (LZ4) {
141142
libraries.push('library_lz4.js');
142143
}

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)