Closed itstristanb closed 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)
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.
Additionally, I am not sure if the Win32 implementation of IMGUI and our own WinAPI handler can even be built without including windows.h.
ImGUI shouldn't need to be recompiled after the first compilation since it will just use the old .obj
s. Regarding our WinAPI handler, we could probably pull out the includes we need similar to the first recommended solution.
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
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.
Thanks to @ShumWengSang , this was implemented in #71 .
Good idea to shorten the compile time, but what would you include instead of
windows.h
?