[x265] [PATCH] add MacOS aarch64 build support

Mahesh Pittala mahesh at multicorewareinc.com
Sat Apr 1 04:33:19 UTC 2023


>From 753305affb093ae15d5e4b333125267b16258c21 Mon Sep 17 00:00:00 2001
From: Barath Nithish <bharath.lingasamy at multicorewareinc.com>
Date: Sat, 1 Apr 2023 09:55:13 +0530
Subject: [PATCH] add MacOS aarch64 build support

Signed-off-by: maheshpittala <mahesh at multicorewareinc.com>
---
 build/aarch64-darwin/crosscompile.cmake  | 15 +++++++++++++++
 build/aarch64-darwin/make-Makefiles.bash |  4 ++++
 2 files changed, 19 insertions(+)
 create mode 100644 build/aarch64-darwin/crosscompile.cmake
 create mode 100644 build/aarch64-darwin/make-Makefiles.bash

diff --git a/build/aarch64-darwin/crosscompile.cmake
b/build/aarch64-darwin/crosscompile.cmake
new file mode 100644
index 000000000..c35f73dc4
--- /dev/null
+++ b/build/aarch64-darwin/crosscompile.cmake
@@ -0,0 +1,15 @@
+# CMake toolchain file for cross compiling x265 for aarch64
+# This feature is only supported as experimental. Use with caution.
+# Please report bugs on bitbucket
+# Run cmake with: cmake -DCMAKE_TOOLCHAIN_FILE=crosscompile.cmake -G "Unix
Makefiles" ../../source && ccmake ../../source
+
+set(CROSS_COMPILE_ARM64 1)
+set(CMAKE_SYSTEM_NAME Darwin)
+set(CMAKE_SYSTEM_PROCESSOR aarch64)
+
+# specify the cross compiler
+set(CMAKE_C_COMPILER gcc-12)
+set(CMAKE_CXX_COMPILER g++-12)
+
+# specify the target environment
+SET(CMAKE_FIND_ROOT_PATH  /opt/homebrew/bin/)
diff --git a/build/aarch64-darwin/make-Makefiles.bash
b/build/aarch64-darwin/make-Makefiles.bash
new file mode 100644
index 000000000..c9582da0a
--- /dev/null
+++ b/build/aarch64-darwin/make-Makefiles.bash
@@ -0,0 +1,4 @@
+#!/bin/bash
+# Run this from within a bash shell
+
+cmake -DCMAKE_TOOLCHAIN_FILE="crosscompile.cmake" -G "Unix Makefiles"
../../source && ccmake ../../source
-- 
2.23.0.windows.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20230401/6e2802cd/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aarch64-macos-build-support.diff
Type: application/octet-stream
Size: 1741 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20230401/6e2802cd/attachment.obj>


More information about the x265-devel mailing list