In the previous setup, manual macro definitions were added via add_compile_definitions for the Debug, RelWithDebInfo, and Release configurations. However, Visual Studio already defines the _DEBUG macro automatically in Debug builds, and additionally defining DEBUG in CMake caused a mismatch: the code checks for _DEBUG, while DEBUG was being defined, resulting in the expected behavior not being triggered. Similarly, the _DISTRIBUTE macro was bound individually to specific configurations, which made it appear inactive in some cases and introduced the risk of being forgotten when new build configurations were added. For these reasons, all manual add_compile_definitions statements were removed, relying instead on the standard macros provided by the compiler. This change eliminates ambiguity and conflicts between build configurations, making Debug and Release behaviors clearer, more predictable, and easier to maintain.
image