Skip to content

MacOS CMake Rejects arm64 arch #1749

@jkeller51

Description

@jkeller51

Subject of the issue

SFML/CMakeLists.txt contains this fatal error in the MacOS section:

    # only the default architecture (i.e. 64-bit) is supported
    if(NOT CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
        message(FATAL_ERROR "Only 64-bit architecture is supported")
    endif()

However, when bypass this check I am able to build and run native arm64 just fine on a MacBook Pro with an M1 processor.

Your environment

macOS Big Sur 11.2
Xcode 12.4
CMAKE_OSX_ARCHITECTURES = "x86_64;arm64"

Suggested Solution

Split the CMAKE_OSX_ARCHITECTURES by semicolon and make sure each item is either x86_64 or arm64. I'm not a CMake wizard but I could maybe do this within a few days.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions