Fix two packaging bugs

logger.hpp: extend ERROR macro push/pop region to cover entire header so
LogLevel::ERROR inside template bodies compiles correctly on Windows

CMakeLists.txt: move tool install() rules next to each target definition
so they run after the targets exist (fixes macOS 'target does not exist')
This commit is contained in:
Kelsi 2026-02-18 18:29:34 -08:00
parent f2c7e5826e
commit fbb0b76362
2 changed files with 14 additions and 12 deletions

View file

@ -9,10 +9,13 @@
namespace wowee {
namespace core {
// Suppress the wingdi.h "#define ERROR 0" macro for the entire header so that
// LogLevel::ERROR inside template bodies compiles correctly on Windows.
#ifdef _WIN32
#pragma push_macro("ERROR")
#undef ERROR
#endif
enum class LogLevel {
DEBUG,
INFO,
@ -20,9 +23,6 @@ enum class LogLevel {
ERROR,
FATAL
};
#ifdef _WIN32
#pragma pop_macro("ERROR")
#endif
class Logger {
public:
@ -85,3 +85,8 @@ private:
} // namespace core
} // namespace wowee
// Restore the ERROR macro now that all LogLevel::ERROR references are done.
#ifdef _WIN32
#pragma pop_macro("ERROR")
#endif