mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-12-13 04:36:59 +00:00
Make it easy to build Cemu on BSD (#1632)
This commit is contained in:
parent
955ce9b973
commit
4efa40c51c
41 changed files with 167 additions and 57 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue