|
1 | | -From 37539a89a25855f8c524f9d4f8ae6c27b49ed5a7 Mon Sep 17 00:00:00 2001 |
| 1 | +From f917723823e81581edf8d6554edb054d28761fec Mon Sep 17 00:00:00 2001 |
2 | 2 | From: Hood Chatham < [email protected]> |
3 | 3 | Date: Fri, 31 Jan 2025 11:42:59 +0100 |
4 | 4 | Subject: [PATCH 5/5] sdl2_image wasm-sjlj variant |
5 | 5 |
|
6 | 6 | Upstream PR: |
7 | 7 | https://github.com/emscripten-core/emscripten/pull/23554 |
8 | 8 | --- |
9 | | - tools/ports/sdl2_image.py | 15 ++++++++++----- |
10 | | - 1 file changed, 10 insertions(+), 5 deletions(-) |
| 9 | + tools/ports/sdl2_image.py | 5 +++++ |
| 10 | + 1 file changed, 5 insertions(+) |
11 | 11 |
|
12 | 12 | diff --git a/tools/ports/sdl2_image.py b/tools/ports/sdl2_image.py |
13 | | -index c72ef576b..0d3b758bd 100644 |
| 13 | +index 70fa1499a..ed5ad679b 100644 |
14 | 14 | --- a/tools/ports/sdl2_image.py |
15 | 15 | +++ b/tools/ports/sdl2_image.py |
16 | | -@@ -42,6 +42,8 @@ def get_lib_name(settings): |
17 | | - libname = 'libSDL2_image' |
18 | | - if formats != '': |
19 | | - libname += '_' + formats |
| 16 | +@@ -46,6 +46,8 @@ def get_lib_name(settings): |
| 17 | + libname += '-' + formats |
| 18 | + if settings.PTHREADS: |
| 19 | + libname += '-mt' |
20 | 20 | + if settings.SUPPORT_LONGJMP == 'wasm': |
21 | 21 | + libname += '-wasm-sjlj' |
22 | 22 | return libname + '.a' |
23 | 23 |
|
24 | 24 |
|
25 | | -@@ -58,20 +60,23 @@ def get(ports, settings, shared): |
26 | | - IMG_tif.c IMG_xcf.c IMG_xpm.c IMG_xv.c IMG_webp.c IMG_ImageIO.m |
27 | | - IMG_avif.c IMG_jxl.c IMG_svg.c IMG_qoi.c'''.split() |
| 25 | +@@ -78,6 +80,9 @@ def get(ports, settings, shared): |
| 26 | + if settings.PTHREADS: |
| 27 | + flags += ['-pthread'] |
28 | 28 |
|
29 | | -- defs = ['-O2', '-sUSE_SDL=2', '-Wno-format-security'] |
30 | | -+ flags = ['-O2', '-sUSE_SDL=2', '-Wno-format-security'] |
31 | | - |
32 | | - formats = get_formats(settings) |
33 | | - |
34 | | - for fmt in formats: |
35 | | -- defs.append('-DLOAD_' + fmt.upper()) |
36 | | -+ flags.append('-DLOAD_' + fmt.upper()) |
37 | | - |
38 | | - if 'png' in formats: |
39 | | -- defs += ['-sUSE_LIBPNG'] |
40 | | -+ flags += ['-sUSE_LIBPNG'] |
41 | | - |
42 | | - if 'jpg' in formats: |
43 | | -- defs += ['-sUSE_LIBJPEG'] |
44 | | -+ flags += ['-sUSE_LIBJPEG'] |
45 | | - |
46 | | -- ports.build_port(src_dir, final, 'sdl2_image', flags=defs, srcs=srcs) |
47 | 29 | + if settings.SUPPORT_LONGJMP == 'wasm': |
48 | 30 | + flags.append('-sSUPPORT_LONGJMP=wasm') |
49 | 31 | + |
50 | | -+ ports.build_port(src_dir, final, 'sdl2_image', flags=flags, srcs=srcs) |
| 32 | + ports.build_port(src_dir, final, 'sdl2_image', flags=flags, srcs=srcs) |
51 | 33 |
|
52 | 34 | return [shared.cache.get_lib(libname, create, what='port')] |
53 | | - |
54 | 35 | -- |
55 | 36 | 2.34.1 |
56 | 37 |
|
0 commit comments