Commit 3f71ae1
authored
demo/sdl3_renderer: Rewrite SDL3 Makefile to support Emscripten (#894)
* fix(demo/sdl3_renderer): Makefile should now support Win + Emsdk
Fixed several issues that would prevent this demo from being compilable
on Windows with Emscripten: (1) there was a typo preventing proper
resolution of BINEXT, (2) in case of using Emscripten, Windows was taking
a precedense due to OS always being defined, (3) BINEXT now has a
special case for Emscipten, (4) pkg-config provided by w64devkit has no
--path flag, so we retry with --exists too, (5) compiler invocation was
missing system flags, which could break on some MSYS2 runtimes,
(6) compiler invocation now uses all kinds of C/CPP/LD flags so you can
easily inject something like --shell-file now, and probably more...
This was done in order to help with implementing and testing for:
#888
* refactor(demo/sdl3_renderer): consistent syntax and flow in Makefile
Use ${} for variable expansion and $() for invoking functions.
Use $(or ...) for all branches instead of ifeq(...) blocks.
Hopefully, this will make it easier to read and understand.
* fix(demo/sdl3_renderer): append user provided C/CPP/LD flags in Makefile
Before it was overwriting those flags entirely, meaning that it could
delete some required ones (e.g. from pkg-config). Now it will append
them correctly, so your flags will take priority where it matters.1 parent a329721 commit 3f71ae1
1 file changed
Lines changed: 42 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | | - | |
18 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 23 | + | |
| 24 | + | |
26 | 25 | | |
27 | | - | |
28 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | | - | |
| 33 | + | |
| 34 | + | |
31 | 35 | | |
32 | | - | |
| 36 | + | |
| 37 | + | |
33 | 38 | | |
34 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
35 | 50 | | |
36 | | - | |
| 51 | + | |
37 | 52 | | |
38 | | - | |
| 53 | + | |
39 | 54 | | |
40 | | - | |
| 55 | + | |
41 | 56 | | |
0 commit comments