Merge the shell backends into one Shell library - #53
Conversation
Fold both backends into a single Shell library (folder-separated only: Desktop/ = SDL3, Null/ = headless), so Shell is the only shell library and SDL3 is a fully internal PRIVATE dependency. - The two per-backend factory units collapse into one Shell.cpp bridge that dispatches createShell()/destroyShell() to the backend chosen at compile time via DRACO_SHELL_SDL3. - Both backend modules (shell.desktop, shell.null) compile into the one library, so both stay independently testable in every build. - Runtime links only Shell; the sample links only Runtime. SDL propagates through Shell's PRIVATE link, so nothing downstream links SDL directly. The SDL whole-archive force-load stays on the executable (not Shell) so it does not force a full SDL copy into the intermediate Runtime library. Both shell tests pass and RenderSample builds and runs.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthroughThe shell build is consolidated into one ChangesShell unification
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Runtime
participant Shell
participant Backend
Runtime->>Shell: createShell(settings)
Shell->>Backend: construct selected shell backend
Backend-->>Shell: IShell instance
Shell-->>Runtime: return IShell*
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| // the bridge decides which one createShell() builds. | ||
| module shell; | ||
|
|
||
| #if DRACO_SHELL_SDL3 |
There was a problem hiding this comment.
I know you defined DRACO_SHELL_SDL3 as 1 in the cmake file but it would probably make more sense to use #ifdef here since we don't care about the value we care if it is defined. Technically the same thing in this case but the #if relies on the value of the macro being truthy instead of it simply existing.
Fold both backends into a single Shell library (folder-separated only: Desktop/ = SDL3, Null/ = headless), so Shell is the only shell library and SDL3 is a fully internal PRIVATE dependency.
Both shell tests pass and RenderSample builds and runs.
Summary by CodeRabbit
New Features
Tests