Skip to content

Commit

Permalink
[wasm backend] Fix SDL2 + pthreads (#8960)
Browse files Browse the repository at this point in the history
We included the extra SDL2 files for threading, but we were not building any of them with pthreads enabled.

See #8503
  • Loading branch information
kripken authored Jul 11, 2019
1 parent 30d5091 commit 5e5e79d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion tests/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3013,7 +3013,6 @@ def test_sdl2_mouse_offsets(self):
self.run_browser('page.html', '', '/report_result?1')

@requires_threads
@no_wasm_backend('need sdl2 build with pthreads')
def test_sdl2_threads(self):
self.btest('sdl2_threads.c', expected='4', args=['-s', 'USE_PTHREADS=1', '-s', 'USE_SDL=2', '-s', 'PROXY_TO_PTHREAD=1'])

Expand Down
5 changes: 4 additions & 1 deletion tools/ports/sdl2.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ def create():
for src in srcs:
o = os.path.join(ports.get_build_dir(), 'sdl2', 'src', src + '.o')
shared.safe_ensure_dirs(os.path.dirname(o))
commands.append([shared.PYTHON, shared.EMCC, os.path.join(ports.get_dir(), 'sdl2', SUBDIR, 'src', src), '-O2', '-o', o, '-I' + dest_include_path, '-O2', '-DUSING_GENERATED_CONFIG_H', '-w'])
command = [shared.PYTHON, shared.EMCC, os.path.join(ports.get_dir(), 'sdl2', SUBDIR, 'src', src), '-O2', '-o', o, '-I' + dest_include_path, '-O2', '-DUSING_GENERATED_CONFIG_H', '-w']
if settings.USE_PTHREADS:
command += ['-s', 'USE_PTHREADS']
commands.append(command)
o_s.append(o)
ports.run_commands(commands)
final = os.path.join(ports.get_build_dir(), 'sdl2', libname)
Expand Down

0 comments on commit 5e5e79d

Please sign in to comment.