Skip to content

cmake: list-separate frameworks in FindMETAL.cmake#811

Open
slitvinov wants to merge 1 commit intolibocca:mainfrom
slitvinov:metal-cmake-list
Open

cmake: list-separate frameworks in FindMETAL.cmake#811
slitvinov wants to merge 1 commit intolibocca:mainfrom
slitvinov:metal-cmake-list

Conversation

@slitvinov
Copy link
Copy Markdown

@slitvinov slitvinov commented May 2, 2026

INTERFACE_LINK_LIBRARIES expects a CMake list (semicolon-separated). The space-separated form in cmake/FindMETAL.cmake:24 makes CMake treat the three framework paths as a single one. On macOS arm64 with a recent Xcode SDK the linker fails:

ld: warning: search path '/.../Metal.framework /.../CoreServices.framework /.../Frameworks' not found
Undefined symbols for architecture arm64:
  "_MTLCopyAllDevices", referenced from:
      occa::api::metal::getDeviceCount() in metal.mm.o
ld: symbol(s) not found for architecture arm64

One-character fix: replace the spaces with semicolons.

INTERFACE_LINK_LIBRARIES expects a CMake list (semicolon-separated).
The space-separated form makes CMake treat the three framework paths
as a single one, and the linker fails:

    ld: warning: search path '/.../Metal.framework /.../CoreServices.framework /.../Frameworks' not found
    Undefined symbols for architecture arm64: "_MTLCopyAllDevices"

One-character fix on macOS arm64 with a recent Xcode SDK.
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