Skip to content

fix: consistent macOS deployment target for Metal compatibility#320

Open
nicholasjpaterno wants to merge 2 commits intooxiglade:mainfrom
nicholasjpaterno:fix/macos-deployment-target
Open

fix: consistent macOS deployment target for Metal compatibility#320
nicholasjpaterno wants to merge 2 commits intooxiglade:mainfrom
nicholasjpaterno:fix/macos-deployment-target

Conversation

@nicholasjpaterno
Copy link
Contributor

@nicholasjpaterno nicholasjpaterno commented Feb 20, 2026

Summary

Ensures cmake, C++ compiler, and Rust linker all use the same macOS deployment target, preventing ___isPlatformVersionAtLeast linking errors.

  • Respects MACOSX_DEPLOYMENT_TARGET env var, defaults to 14.0 (MLX's minimum)
  • Sets CMAKE_OSX_DEPLOYMENT_TARGET and -mmacosx-version-min linker flag consistently
  • Links Xcode's clang_rt.osx runtime for the ___isPlatformVersionAtLeast symbol (needed on macOS 26+)
  • Adds cargo:rerun-if-env-changed for rebuild on env var change

Ref: ml-explore/mlx#1602

- Respects MACOSX_DEPLOYMENT_TARGET env var (defaults to 14.0)
- Sets CMAKE_OSX_DEPLOYMENT_TARGET to match
- Passes matching -mmacosx-version-min to linker
- Adds cargo:rerun-if-env-changed for proper rebuilds

Fixes ___isPlatformVersionAtLeast linking errors by ensuring all
components (cmake, C++ compiler, Rust linker) use consistent target.

Ref: ml-explore/mlx#1602
@nicholasjpaterno nicholasjpaterno force-pushed the fix/macos-deployment-target branch from 03bdbb0 to af169d7 Compare February 21, 2026 15:01
…y comment

- Deduplicate MACOSX_DEPLOYMENT_TARGET resolution into a helper function
- Add SAFETY comment on set_var (build scripts are single-threaded)
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.

1 participant