Add Windows build support via MSYS2 and fix platform-specific code

Guard X11 display crash handler with __linux__, add Windows GlobalMemoryStatusEx
path in memory_monitor, guard warden cache paths with APPDATA on Windows, and
make pkg-config optional in CMakeLists with a find_library fallback. Add Windows
x86-64 CI job using MSYS2 MINGW64 to the build workflow.
This commit is contained in:
Kelsi 2026-02-18 17:38:08 -08:00
parent 02fd0166e9
commit cb01821d89
6 changed files with 125 additions and 16 deletions

View file

@ -906,13 +906,18 @@ bool WardenModule::initializeModule() {
// ============================================================================
WardenModuleManager::WardenModuleManager() {
// Set cache directory: ~/.local/share/wowee/warden_cache/
const char* home = std::getenv("HOME");
if (home) {
// Set cache directory
#ifdef _WIN32
if (const char* appdata = std::getenv("APPDATA"))
cacheDirectory_ = std::string(appdata) + "\\wowee\\warden_cache";
else
cacheDirectory_ = ".\\warden_cache";
#else
if (const char* home = std::getenv("HOME"))
cacheDirectory_ = std::string(home) + "/.local/share/wowee/warden_cache";
} else {
else
cacheDirectory_ = "./warden_cache";
}
#endif
// Create cache directory if it doesn't exist
std::filesystem::create_directories(cacheDirectory_);