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

@ -389,15 +389,7 @@ install(TARGETS wowee
ARCHIVE DESTINATION lib
)
# Install tools alongside main binary
foreach(_tool dbc_to_csv blp_convert auth_probe auth_login_probe)
if(TARGET ${_tool})
install(TARGETS ${_tool} RUNTIME DESTINATION bin)
endif()
endforeach()
if(STORMLIB_LIBRARY AND STORMLIB_INCLUDE_DIR)
install(TARGETS asset_extract RUNTIME DESTINATION bin)
endif()
# Note: tool install rules are placed next to each target definition below.
# Install built-in assets (exclude proprietary music)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/assets
@ -451,6 +443,7 @@ if(STORMLIB_LIBRARY AND STORMLIB_INCLUDE_DIR)
set_target_properties(asset_extract PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
install(TARGETS asset_extract RUNTIME DESTINATION bin)
message(STATUS " asset_extract tool: ENABLED")
else()
message(STATUS " asset_extract tool: DISABLED (requires StormLib)")
@ -469,6 +462,7 @@ target_link_libraries(dbc_to_csv PRIVATE Threads::Threads)
set_target_properties(dbc_to_csv PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
install(TARGETS dbc_to_csv RUNTIME DESTINATION bin)
# ---- Tool: auth_probe (LOGON_CHALLENGE probe) ----
add_executable(auth_probe
@ -488,6 +482,7 @@ target_link_libraries(auth_probe PRIVATE Threads::Threads OpenSSL::Crypto)
set_target_properties(auth_probe PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
install(TARGETS auth_probe RUNTIME DESTINATION bin)
# ---- Tool: auth_login_probe (challenge + proof probe) ----
add_executable(auth_login_probe
@ -510,6 +505,7 @@ target_link_libraries(auth_login_probe PRIVATE Threads::Threads OpenSSL::Crypto)
set_target_properties(auth_login_probe PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
install(TARGETS auth_login_probe RUNTIME DESTINATION bin)
# ---- Tool: blp_convert (BLP ↔ PNG) ----
add_executable(blp_convert
@ -525,6 +521,7 @@ target_link_libraries(blp_convert PRIVATE Threads::Threads)
set_target_properties(blp_convert PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
install(TARGETS blp_convert RUNTIME DESTINATION bin)
# Print configuration summary
message(STATUS "")

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