mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-05 04:33:51 +00:00
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:
parent
f2c7e5826e
commit
fbb0b76362
2 changed files with 14 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue