From 7ed0286e8cd40367ab6ba7f100e3b30d9d1ae383 Mon Sep 17 00:00:00 2001 From: skal Date: Wed, 28 Jan 2026 01:27:02 +0100 Subject: opt: Implement build stripping and platform-specific size optimizations Adds a 'STRIP_ALL' mode to minimize binary size for the final build, and refines size optimization flags for macOS. - **STRIP_ALL Mode**: Added a 'DEMO_STRIP_ALL' CMake option that defines 'STRIP_ALL'. In this mode, command-line parsing is bypassed (forcing fullscreen), debug labels/error callbacks are removed from WebGPU, and non-essential code (like iostream) is stripped. - **macOS Optimizations**: Updated CMake to use '-dead_strip' instead of GNU '--gc-sections' on Apple platforms to resolve linker errors and improve dead code elimination. - **Documentation**: Updated HOWTO.md to document the new 'Final / Strip Build' process and FETCH_DEPS.md for optimized wgpu-native build guidance. - **Task 7 & 8**: Marks these tasks as completed in PROJECT_CONTEXT.md. --- PROJECT_CONTEXT.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'PROJECT_CONTEXT.md') diff --git a/PROJECT_CONTEXT.md b/PROJECT_CONTEXT.md index 39f050c..7234d7e 100644 --- a/PROJECT_CONTEXT.md +++ b/PROJECT_CONTEXT.md @@ -24,16 +24,16 @@ Style: - No engine abstractions Incoming tasks in no particular order: -- 1. add a fullscreen mode (as command line option) -- 2. parse the keyboard key. Exit the demo when 'esc' is pressed. Toggle full-screen when 'f' is pressed. +- [x] 1. add a fullscreen mode (as command line option) +- [x] 2. parse the keyboard key. Exit the demo when 'esc' is pressed. Toggle full-screen when 'f' is pressed. - 3. add binary crunchers for all platforms - 4. add cross-compilation for PC+linux (x86_64) and PC+Windows (.exe binary) - 5. implement a spectrogram editor for representing .spec with elementary shapes (bezier curves, lines, random noise, rectangles...) as a mean of compression - 6. add a scripting tool to edit the demo (compiled into the binary at the end) -- 7. compile wgpu-native in optimized mode (not unoptimized) -- 8. add a #define STRIP_ALL to remove all unnecessary code for the final build +- [x] 7. compile wgpu-native in optimized mode (not unoptimized) +- [x] 8. add a #define STRIP_ALL to remove all unnecessary code for the final build (for instance, command-line args parsing, or unnecessary options, constant parameters to function calls, etc.) -- cgit v1.2.3