StarGate01 / AmongUs-Mumble

Mumble VoIP Plugin and mod for the popular game "Among Us" to enable Proximity Voice Chat.
GNU General Public License v3.0
108 stars 13 forks source link

Added a todo for faster compile times #48

Closed itstristanb closed 3 years ago

StarGate01 commented 3 years ago

Good idea to shorten the compile time, but what would you include instead of windows.h?

avail commented 3 years ago

windows.h includes a bunch of files, as opposed to including windows you could include only things you need (i.e. cstdint or whatever is used)

StarGate01 commented 3 years ago

I see your point. windows.h is used in quite a few places in the project, and I reckon we would have to get rid of all includes.

However, e.g. helper.cpp uses GetModuleHandleW - which is declared in libloaderapi.h. However, this header cannot be included on its own, see: https://stackoverflow.com/questions/4845198/fatal-error-no-target-architecture-in-visual-studio/4845893#4845893

I am open to ideas.

StarGate01 commented 3 years ago

Additionally, I am not sure if the Win32 implementation of IMGUI and our own WinAPI handler can even be built without including windows.h.

alisenai commented 3 years ago

ImGUI shouldn't need to be recompiled after the first compilation since it will just use the old .objs. Regarding our WinAPI handler, we could probably pull out the includes we need similar to the first recommended solution.

avail commented 3 years ago

Do you use precompiled headers? You could use a pch so it doesn't have to recompile for each file, and have windows.h in that one only

alisenai commented 3 years ago

Similar to how building ImGUI would "cache" it, a PCH (stdafx) could be the easiest solution to this for sure. That's a good idea.

Anyone here actually have compilation time issues? I can do a full rebuild in under ~30s currently.

StarGate01 commented 3 years ago

Thanks to @ShumWengSang , this was implemented in #71 .