Skip to content

Fix iOS SystemMonitor platform selection - #2363

Open
tirlarim wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
tirlarim:codex/fix-ios-system-monitor
Open

tirlarim wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
tirlarim:codex/fix-ios-system-monitor

Conversation

@tirlarim

@tirlarim tirlarim commented Nov 4, 2026

Copy link
Copy Markdown

Summary

iOS defines __APPLE__, so SystemMonitor.cpp selects the macOS backend and fails to compile against the iPhoneOS SDK at IOKit/graphics/IOGraphicsLib.h.

  • Include TargetConditionals.h explicitly and select the macOS backend only when TARGET_OS_OSX is true. iOS uses the existing empty monitor implementation.
  • Link the desktop monitor frameworks only for macOS (CMAKE_SYSTEM_NAME is Darwin), in both the library and CPU tests.
  • Apply the same platform distinction to the existing virtual display tests.

Fixes #2362.

Validation

Tested with Apple Clang 21.0.0 and the Xcode 27.0 SDKs on Apple Silicon.

  • Reproduced the missing IOGraphicsLib.h error by cross-compiling the original SystemMonitor.cpp for iOS.
  • Cross-compiled the patched SystemMonitor.cpp and Config_tests.cpp to arm64 object files for both iOS 27.0 devices and the iOS 27.0 simulator.
  • Built the native macOS shared library and CPU tests in RelWithDebInfo, with SIMD disabled. Confirmed the macOS backend and desktop framework linkage are retained.
  • Ran ctest --test-dir build/codex-macos-apple --output-on-failure: test_utils_exec passed; 1173 of 1175 CPU tests passed. The two numerical tolerance failures below also occur on the unmodified main commit (22dd9c4) using the same build configuration:
    • OpOptimizers/gamma_comp_test2
    • GammaOpCPU/apply_moncurve_mirror_style_fwd
  • Ran the complete Config CPU test group separately; all tests passed, including the virtual display tests.
  • git diff --check passed.

The iOS checks compile the affected translation units; a complete iOS library build and device execution have not been performed.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: tirlarim / name: Stanislav Romanov (7082db0)

Signed-off-by: Stanislav Romanov <stasromanov801@gmail.com>
@tirlarim
tirlarim force-pushed the codex/fix-ios-system-monitor branch from 7082db0 to 9fd1861 Compare November 4, 2026 09:00
@tirlarim
tirlarim marked this pull request as ready for review November 4, 2026 09:09

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS build selects the macOS SystemMonitor backend via __APPLE__

1 participant