You are correct, I had misremembered how it works. It can evaluate build arguments, but they have to be numerical. However you can define new variables (in the pre-processor, not in code - ie, after a #) to replace those numbers, to make the intent clearer. Eg.
#define DEBUG_1 1
#define DEBUG_2 2
#if DEBUG_LEVEL >= DEBUG_1
Then pass the build arg DEBUG_LEVEL at compile time
You are correct, I had misremembered how it works. It can evaluate build arguments, but they have to be numerical. However you can define new variables (in the pre-processor, not in code - ie, after a #) to replace those numbers, to make the intent clearer. Eg.
#define DEBUG_1 1
#define DEBUG_2 2
#if DEBUG_LEVEL >= DEBUG_1
Then pass the build arg DEBUG_LEVEL at compile time
More info here:
https://learn.microsoft.com/en-us/cpp/preprocessor/hash-if-hash-elif-hash-else-and-hash-endif-directives-c-cpp?view=msvc-170
Edit: formatting of code snippet