Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -2617,6 +2617,14 @@ def test_sdl2_gfx_linkable(self):
self.emcc('browser/test_sdl2_misc.c', ['-Wl,-fatal-warnings', '-sMAIN_MODULE', '-sUSE_SDL_GFX=2', '-o', 'a.out.js'])
self.emcc('browser/test_sdl2_misc.c', ['-Wl,-fatal-warnings', '-sMAIN_MODULE', '--use-port=sdl2_gfx', '-o', 'a.out.js'])

@with_all_sjlj
@requires_network
def test_sdl2_image_linkable(self):
# Same as above but for sdl2_image library
self.emcc('browser/test_sdl2_misc.c', ['-Wl,-fatal-warnings', '-sMAIN_MODULE', '-sUSE_SDL_IMAGE=2', '-o', 'a.out.js'])
self.emcc('browser/test_sdl2_misc.c', ['-Wl,-fatal-warnings', '-sMAIN_MODULE', '--use-port=sdl2_image', '-o', 'a.out.js'])

@with_all_sjlj
@requires_network
def test_libpng(self):
copy_asset('third_party/libpng/pngtest.png')
Expand All @@ -2625,6 +2633,7 @@ def test_libpng(self):
self.do_runf('third_party/libpng/pngtest.c', 'libpng passes test',
cflags=['--embed-file', 'pngtest.png', '--use-port=libpng'])

@with_all_sjlj
@requires_pthreads
@requires_network
def test_libpng_with_pthreads(self):
Expand Down
11 changes: 9 additions & 2 deletions tools/ports/freetype.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
PKG_VERSION = '26.2.20'
HASH = '460ea4dc9cc879822556d801341a1cf3efcd57a13cd4da64169603ea98873337dd19e3c8c6d9054b27d10acbbaa8d5c59b7f560c697b98dc2640bcd88f57554a'

variants = {'freetype-legacysjlj': {'SUPPORT_LONGJMP': 'wasm', 'WASM_LEGACY_EXCEPTIONS': 1}}
variants = {
'freetype-wasmsjlj': {'SUPPORT_LONGJMP': 'wasm', 'WASM_LEGACY_EXCEPTIONS': 0},
'freetype-legacysjlj': {'SUPPORT_LONGJMP': 'wasm', 'WASM_LEGACY_EXCEPTIONS': 1},
}
deps = ['zlib']


Expand All @@ -20,7 +23,10 @@ def needed(settings):

def get_lib_name(settings):
if settings.SUPPORT_LONGJMP == 'wasm':
return 'libfreetype-legacysjlj.a'
if settings.WASM_LEGACY_EXCEPTIONS:
return 'libfreetype-legacysjlj.a'
else:
return 'libfreetype-wasmsjlj.a'
else:
return 'libfreetype.a'

Expand Down Expand Up @@ -97,6 +103,7 @@ def create(final):

if settings.SUPPORT_LONGJMP == 'wasm':
flags.append('-sSUPPORT_LONGJMP=wasm')
flags.append(f'-sWASM_LEGACY_EXCEPTIONS={settings.WASM_LEGACY_EXCEPTIONS}')

ports.make_pkg_config('freetype2', PKG_VERSION, '-sUSE_FREETYPE')
ports.build_port(source_path, final, 'freetype', flags=flags, srcs=srcs)
Expand Down
8 changes: 7 additions & 1 deletion tools/ports/libpng.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
deps = ['zlib']
variants = {
'libpng-mt': {'PTHREADS': 1},
'libpng-wasmsjlj': {'SUPPORT_LONGJMP': 'wasm', 'WASM_LEGACY_EXCEPTIONS': 0},
'libpng-mt-wasmsjlj': {'PTHREADS': 1, 'SUPPORT_LONGJMP': 'wasm', 'WASM_LEGACY_EXCEPTIONS': 0},
'libpng-legacysjlj': {'SUPPORT_LONGJMP': 'wasm', 'WASM_LEGACY_EXCEPTIONS': 1},
'libpng-mt-legacysjlj': {'PTHREADS': 1, 'SUPPORT_LONGJMP': 'wasm', 'WASM_LEGACY_EXCEPTIONS': 1},
}
Expand All @@ -27,7 +29,10 @@ def get_lib_name(settings):
if settings.PTHREADS:
suffix += '-mt'
if settings.SUPPORT_LONGJMP == 'wasm':
suffix += '-legacysjlj'
if settings.WASM_LEGACY_EXCEPTIONS:
suffix += '-legacysjlj'
else:
suffix += '-wasmsjlj'
return f'libpng{suffix}.a'


Expand All @@ -46,6 +51,7 @@ def create(final):
flags += ['-pthread']
if settings.SUPPORT_LONGJMP == 'wasm':
flags.append('-sSUPPORT_LONGJMP=wasm')
flags.append(f'-sWASM_LEGACY_EXCEPTIONS={settings.WASM_LEGACY_EXCEPTIONS}')

ports.build_port(source_path, final, 'libpng', flags=flags, exclude_files=['pngtest'], exclude_dirs=['scripts', 'contrib'])

Expand Down
6 changes: 5 additions & 1 deletion tools/ports/sdl2_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ def get_lib_name(settings):
if settings.PTHREADS:
libname += '-mt'
if settings.SUPPORT_LONGJMP == 'wasm':
libname += '-wasm-sjlj'
if settings.WASM_LEGACY_EXCEPTIONS:
libname += '-legacysjlj'
else:
libname += '-wasmsjlj'
return libname + '.a'


Expand Down Expand Up @@ -76,6 +79,7 @@ def create(final):

if settings.SUPPORT_LONGJMP == 'wasm':
flags.append('-sSUPPORT_LONGJMP=wasm')
flags.append(f'-sWASM_LEGACY_EXCEPTIONS={settings.WASM_LEGACY_EXCEPTIONS}')

ports.build_port(src_dir, final, 'sdl2_image', flags=flags, srcs=srcs)

Expand Down
Loading