Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for native Apple M1 ARM builds! #1298

Merged
merged 6 commits into from
Mar 12, 2024

Commits on Mar 11, 2024

  1. Work around std::filesystem being unavailable on mac w/ warnings

    The version of the macOS sdk we're using doesn't implement it,
     see more detailed in-code comment included in this commit
    bluebandit21 committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    1666199 View commit details
    Browse the repository at this point in the history
  2. Fix macOS-specific CMake helper for M1 build

    First (pretty obviously), don't set the preprocessor
     define "CPU_X86_64" if we're not actually targeting
     x86_64 :)
    
    Secondly, don't set some linker flags that seem to
     cause problems on aarch64 builds -- with them
     present, launching the binary under lldb exits with
     "Malformed Mach-O file" and regular launches fail
     with mysterious error codes.
    -- Having tested myself, it seems to work just fine
     without them set; I believe that even for x86_64
     they were added by accident! (See in-code comment)
    bluebandit21 committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    dc6df59 View commit details
    Browse the repository at this point in the history
  3. Set appropriate FFMPEG build flags for macOS depending on arch

    If we're targeting a native M1 aarch64 build, obviously we don't
     want to tell FFMpeg to build for x86_64 :)
    bluebandit21 committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    f5d845f View commit details
    Browse the repository at this point in the history
  4. For M1 builds, set deployment target reasonably

    It doesn't make set a deployment target earlier than the first OS
     that actually supports the CPU :)
    bluebandit21 committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    8293d79 View commit details
    Browse the repository at this point in the history
  5. Don't include cpuid.h for non-Linux builds

    We only actually use cpuid.h on Linux, and including it causes
     a problem for M1 builds because it doesn't exist outside x86_64!
    bluebandit21 committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    f6d3eb5 View commit details
    Browse the repository at this point in the history
  6. Add SSE2Neon external dependency

    The calc code uses x86_64 SIMD instrinsics for speed.
    However, those are unavailable on ARM.
    
    SSE2Neon provides ARM equivalents of each missing instruction
     using ARM's Neon SIMD instructions, providing equivalent
     speed for the majority of x86_64 SIMD instructions :)
    bluebandit21 committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    9ec41de View commit details
    Browse the repository at this point in the history