Skip to content

Conversation

@oliverepper
Copy link
Contributor

This fixes the build for MAC_CATALYST_UNIVERSAL.

wcandillon and others added 2 commits June 1, 2025 15:33
My apologies for this AI-generated PR. I am the maintainer of https://github.com/wcandillon/react-native-webgpu and we've always relied on ios-cmake for our CMake builds. It has been tremendously helpful. This AI-generated change helped us fix our macOS build.
Below is the AI-generated description of the change:
```
  ## Problem
  When building for `MAC_UNIVERSAL` platform, CMake fails with the error:
  clang: error: version 'arm64' in target triple 'arm64-apple-macosx11.0-arm64' is invalid

  This occurs because the toolchain generates an invalid target triple `x86_64-arm64-apple-macosx11.0` by combining multiple architectures with dashes, which clang cannot parse.

  ## Root Cause
  The `MAC_UNIVERSAL` configuration was setting `APPLE_TARGET_TRIPLE_INT` to `${ARCHS_SPLIT}-apple-macosx${DEPLOYMENT_TARGET}` where `ARCHS_SPLIT` becomes `x86_64-arm64`. This creates an invalid target triple format that clang rejects.

  ## Solution
  Remove the target triple setting for `MAC_UNIVERSAL` builds and let CMake handle the universal build using the standard `-arch x86_64 -arch arm64` approach. This follows the same pattern used by other COMBINED builds in the toolchain.

  Universal builds should rely on the `-arch` flags rather than target triples, as:
  - Target triples are meant for single architectures
  - Universal builds are handled at the linker level by combining object files from different architectures
  - CMake's built-in universal build support works correctly without explicit target triples
```
@leetal leetal self-assigned this Jul 22, 2025
@leetal leetal self-requested a review July 22, 2025 15:03
@leetal leetal merged commit 05350f8 into leetal:master Jul 22, 2025
21 checks passed
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.

3 participants