Make it easy to build Cemu on BSD (#1632)

This commit is contained in:
Kevin Reinholz 2025-07-22 23:59:09 -07:00 committed by GitHub
parent 955ce9b973
commit 4efa40c51c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 167 additions and 57 deletions

View file

@ -69,7 +69,7 @@
#if BOOST_OS_LINUX
#include <sys/sysinfo.h>
#elif BOOST_OS_MACOS
#elif BOOST_OS_MACOS || BOOST_OS_BSD
#include <sys/types.h>
#include <sys/sysctl.h>
#endif
@ -473,6 +473,12 @@ namespace CafeSystem
int64_t totalRam;
size_t size = sizeof(totalRam);
int result = sysctlbyname("hw.memsize", &totalRam, &size, NULL, 0);
if (result == 0)
cemuLog_log(LogType::Force, "RAM: {}MB", (totalRam / 1024LL / 1024LL));
#elif BOOST_OS_BSD
int64_t totalRam;
size_t size = sizeof(totalRam);
int result = sysctlbyname("hw.physmem", &totalRam, &size, NULL, 0);
if (result == 0)
cemuLog_log(LogType::Force, "RAM: {}MB", (totalRam / 1024LL / 1024LL));
#endif
@ -523,6 +529,16 @@ namespace CafeSystem
platform = "Linux";
#elif BOOST_OS_MACOS
platform = "MacOS";
#elif BOOST_OS_BSD
#if defined(__FreeBSD__)
platform = "FreeBSD";
#elif defined(__OpenBSD__)
platform = "OpenBSD";
#elif defined(__NetBSD__)
platform = "NetBSD";
#else
platform = "Unknown BSD";
#endif
#endif
cemuLog_log(LogType::Force, "Platform: {}", platform);
}