Commit a0aa752
committed
refactor: centralize STB implementation and add Emscripten support
Description:
- Centralized STB implementations: Moved #define STB_IMAGE_IMPLEMENTATION and
related defines from individual command files to a new src/core/stb_impl.cpp to
prevent multiple definition errors and improve compilation times.
- Added Emscripten (WASM) support:
- Forced single-threaded execution in spratlayout, spratpack, and spratunpack
when compiled with __EMSCRIPTEN__.
- Refactored spratlayout packing loops into reusable worker functions
(run_guided_worker, run_shelf_worker) to support both synchronous and
multi-threaded execution paths.
- CMake improvements:
- Integrated command entry points and stb_impl.cpp into the spratcore static
library.
- Enhanced LibArchive discovery to prefer targets and handle include
directories more robustly.
- Made test building conditional on the BUILD_TESTING option.1 parent d475bf0 commit a0aa752
6 files changed
Lines changed: 192 additions & 151 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
126 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
127 | 136 | | |
128 | 137 | | |
129 | 138 | | |
| |||
172 | 181 | | |
173 | 182 | | |
174 | 183 | | |
175 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
176 | 191 | | |
177 | 192 | | |
178 | 193 | | |
| |||
329 | 344 | | |
330 | 345 | | |
331 | 346 | | |
332 | | - | |
333 | | - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
0 commit comments