-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AK/Debug.h design means that any debug toggle needs a full rebuild #5104
Comments
I was thinking about splitting the debug defines into multiple files, one for global stuff That's something that I still need to work out exactly. |
By the way, adding defines to CMake does not mean that everything needs to be rebuild. This is currently only the case because the
|
Why not have one header for each debug feature that occurs in more than one file, and no header at all for conditional dbgln()s that happen in just one file? |
As of last night, step 3 is now:
|
Just ran into this issue. Seems like a pain :( |
I am not completely sure, how I want to fix this. #5106 should be a stop gap for the kernel, and if I do something similar with A few ideas that I've had:
I am not really happy with either option though. |
Can't we just somehow make AK/Debug.h.in only |
Hmm. You mean like this? // file: Something.cpp
#define FOO_DEBUG 1
#include <AK/Debug.h> // file: AK/Debug.h
#ifndef FOO_DEBUG
#cmakedefine01 FOO_DEBUG
#endif Seems like a good compromise. |
Yeah something like that |
I've been thinking, and moving the macro definitions back into the files would is tricky. We do need some sort of Maybe #5104 (comment) is the best solution after all? |
This should be resolved, since #5183 makes it possible to overwrite debug macros in a single compilation unit only. If someone has a better solution, shoot. |
Apparently we put all debug toggles in AK/Debug.h. That means to toggle a debug macro you have these choices:
-D
flag that affects AK/Debug.h. This requires rebuilding everything.true
. This requires rebuilding everything AK/Debug.h, which is almost everything.#define DEBUG_FOO
before including any header (edit: new instructions). That turns on debugging for just that file, but it has these disadvantages:Most
DEBUG_FOO
only affect a single file. This had better ergonomics with the pre AK/Debug.h design, and that old design also had much faster rebuilds.@asynts
The text was updated successfully, but these errors were encountered: