Skip to content

Clean up includes in MainWindow and remove duplicate helper#1955

Merged
Exzap merged 2 commits into
cemu-project:mainfrom
goeiecool9999:cleanups
Jun 13, 2026
Merged

Clean up includes in MainWindow and remove duplicate helper#1955
Exzap merged 2 commits into
cemu-project:mainfrom
goeiecool9999:cleanups

Conversation

@goeiecool9999

@goeiecool9999 goeiecool9999 commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Here is a good overview of the differences in MainWindow.cpp
image

CafeSystem is included from MainWindow.h, likewise for LoggingWindow.h
TitleInfo is included from TitleList, which is already included.
If relying on cascading includes like this is undesired I can add them back.

As far as I can tell the following were entirely unused in MainWindow.cpp:

  • Cafe/Filesystem/FST/FST.h
  • CemuApp.h
  • DownloadGraphicPacksWindow.h
  • GettingStartedDialog.h
  • util/helpers/helpers.h

I've also removed the duplicate to_underlying in favor of the new one in precompiled.h

add back renderer.h because it is actually used in metal builds
@Exzap Exzap merged commit dbec2c7 into cemu-project:main Jun 13, 2026
8 checks passed
@Exzap

Exzap commented Jun 13, 2026

Copy link
Copy Markdown
Member

If relying on cascading includes like this is undesired I can add them back.

Relying on cascaded headers is acceptable within reason I would say. For example getting TitleInfo via including TitleList seems pretty obvious to me. CafeSystem from MainWindow.h is a little less obvious but still ok. But for example indirectly pulling in utility headers via some of the unrelated main headers would be questionable (although no doubt we are doing this by accident already in some places). Basically we want to avoid making the include structure too brittle, where optimizing an include away from some header breaks the build in a completely different and mostly unrelated place.

There is also the concern of build times, where having less cascaded includes in headers is better.

@goeiecool9999

goeiecool9999 commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator Author

There is also the concern of build times, where having less cascaded includes in headers is better.

That is what led me down this track. Excluding precompiled.h MainWindow.cpp expands to ~16MiB of source code after preprocessing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants