diff --git a/.ci/ios/build.sh b/.ci/ios/build.sh index 2f15472178..9ab6cfaaa3 100755 --- a/.ci/ios/build.sh +++ b/.ci/ios/build.sh @@ -4,9 +4,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later WORK_DIR="$PWD" -if [ -z "$NPROC" ]; then - NPROC="$(nproc)" -fi +export IOS_SDK="$(xcrun --sdk iphoneos --show-sdk-path)" [ ! -z "$IOS_SDK" ] @@ -33,4 +31,4 @@ cmake -G Xcode -B build \ -DCPMUTIL_FORCE_BUNDLED=ON \ -DCMAKE_BUILD_TYPE=Release -cmake --build build -- -j${NPROC} +cmake --build build diff --git a/src/common/device_power_state.cpp b/src/common/device_power_state.cpp index 8419434ef2..c777cb4009 100644 --- a/src/common/device_power_state.cpp +++ b/src/common/device_power_state.cpp @@ -15,9 +15,13 @@ extern std::atomic g_has_battery; #elif defined(__APPLE__) #include #if defined(TARGET_OS_MAC) && TARGET_OS_MAC +#if TARGET_OS_IPHONE +// ios doesnt have this +#else #include #include #endif +#endif #elif defined(__linux__) #include #include @@ -47,7 +51,9 @@ namespace Common { info.percentage = g_battery_percentage.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); - +#elif defined(__APPLE__) && TARGET_OS_IPHONE + // Not implemented + info.has_battery = false; #elif defined(__APPLE__) && TARGET_OS_MAC CFTypeRef info_ref = IOPSCopyPowerSourcesInfo(); CFArrayRef sources = IOPSCopyPowerSourcesList(info_ref); @@ -95,7 +101,6 @@ namespace Common { #else info.has_battery = false; #endif - return info; } }