mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-10 03:18:55 +02:00
fx
This commit is contained in:
parent
c04aebe9a4
commit
e4ae4b43bf
2 changed files with 9 additions and 6 deletions
|
|
@ -4,9 +4,7 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
WORK_DIR="$PWD"
|
WORK_DIR="$PWD"
|
||||||
if [ -z "$NPROC" ]; then
|
export IOS_SDK="$(xcrun --sdk iphoneos --show-sdk-path)"
|
||||||
NPROC="$(nproc)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ ! -z "$IOS_SDK" ]
|
[ ! -z "$IOS_SDK" ]
|
||||||
|
|
||||||
|
|
@ -33,4 +31,4 @@ cmake -G Xcode -B build \
|
||||||
-DCPMUTIL_FORCE_BUNDLED=ON \
|
-DCPMUTIL_FORCE_BUNDLED=ON \
|
||||||
-DCMAKE_BUILD_TYPE=Release
|
-DCMAKE_BUILD_TYPE=Release
|
||||||
|
|
||||||
cmake --build build -- -j${NPROC}
|
cmake --build build
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,13 @@ extern std::atomic<bool> g_has_battery;
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
#include <TargetConditionals.h>
|
#include <TargetConditionals.h>
|
||||||
#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
|
#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
|
||||||
|
#if TARGET_OS_IPHONE
|
||||||
|
// ios doesnt have this
|
||||||
|
#else
|
||||||
#include <IOKit/ps/IOPSKeys.h>
|
#include <IOKit/ps/IOPSKeys.h>
|
||||||
#include <IOKit/ps/IOPowerSources.h>
|
#include <IOKit/ps/IOPowerSources.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#elif defined(__linux__)
|
#elif defined(__linux__)
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
@ -47,7 +51,9 @@ namespace Common {
|
||||||
info.percentage = g_battery_percentage.load(std::memory_order_relaxed);
|
info.percentage = g_battery_percentage.load(std::memory_order_relaxed);
|
||||||
info.charging = g_is_charging.load(std::memory_order_relaxed);
|
info.charging = g_is_charging.load(std::memory_order_relaxed);
|
||||||
info.has_battery = g_has_battery.load(std::memory_order_relaxed);
|
info.has_battery = g_has_battery.load(std::memory_order_relaxed);
|
||||||
|
#elif defined(__APPLE__) && TARGET_OS_IPHONE
|
||||||
|
// Not implemented
|
||||||
|
info.has_battery = false;
|
||||||
#elif defined(__APPLE__) && TARGET_OS_MAC
|
#elif defined(__APPLE__) && TARGET_OS_MAC
|
||||||
CFTypeRef info_ref = IOPSCopyPowerSourcesInfo();
|
CFTypeRef info_ref = IOPSCopyPowerSourcesInfo();
|
||||||
CFArrayRef sources = IOPSCopyPowerSourcesList(info_ref);
|
CFArrayRef sources = IOPSCopyPowerSourcesList(info_ref);
|
||||||
|
|
@ -95,7 +101,6 @@ namespace Common {
|
||||||
#else
|
#else
|
||||||
info.has_battery = false;
|
info.has_battery = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue