[x265] [PATCH] cmake: support IPhone cross compile on Mac OS X platform
chen
chenm003 at 163.com
Fri Jul 1 16:56:44 CEST 2016
在 2016-07-01 16:18:27,"Deepthi Nandakumar" <deepthi at multicorewareinc.com> :
On Tue, Jun 28, 2016 at 11:05 PM, Min Chen <chenm003 at 163.com> wrote:
# HG changeset patch
# User Min Chen <min.chen at multicorewareinc.com>
# Date 1467135300 18000
# Node ID 8974c28e7d6ac481028a860a415a31eb64885043
# Parent 626fcbac7ffba723dabd3a9f0507c4c80f3e7bc9
cmake: support IPhone cross compile on Mac OS X platform
diff -r 626fcbac7ffb -r 8974c28e7d6a build/arm-ios/ios.cmake
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/build/arm-ios/ios.cmake Tue Jun 28 12:35:00 2016 -0500
@@ -0,0 +1,18 @@
+# CMake toolchain file for cross compiling x265 for ARM arch
+# 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_ARM 1)
+set(CMAKE_SYSTEM_NAME Darwin)
+set(CMAKE_SYSTEM_PROCESSOR armv7l)
+set(CMAKE_OSX_DEPLOYMENT_TARGET 0)
+
+# specify the cross compiler
+set(CMAKE_C_COMPILER clang)
+set(CMAKE_CXX_COMPILER clang++)
+
+# specify the target environment
+set(CMAKE_FIND_ROOT_PATH ${IOS_PLATFORM_SDK})
+
+
diff -r 626fcbac7ffb -r 8974c28e7d6a build/arm-ios/make-Makefiles.bash
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/build/arm-ios/make-Makefiles.bash Tue Jun 28 12:35:00 2016 -0500
@@ -0,0 +1,7 @@
+#!/bin/bash
+# Run this from within a bash shell
+
+IOS_PLATFORM_SDK=`xcrun --show-sdk-path --sdk iphoneos`
+IOS_CFLAGS="-arch armv7 -mfpu=neon -pthread -miphoneos-version-min=7.0 -Qunused-arguments"
+
+cmake -DCMAKE_TOOLCHAIN_FILE=ios.cmake -DCMAKE_C_FLAGS="$IOS_CFLAGS" -DCMAKE_CXX_FLAGS="$IOS_CFLAGS" -DCMAKE_OSX_SYSROOT="$IOS_PLATFORM_SDK" -DIOS_PLATFORM_SDK="$IOS_PLATFORM_SDK" -G "Unix Makefiles" ../../source && ccmake ../../source
diff -r 626fcbac7ffb -r 8974c28e7d6a source/CMakeLists.txt
--- a/source/CMakeLists.txt Thu Jun 16 12:57:38 2016 +0530
+++ b/source/CMakeLists.txt Tue Jun 28 12:35:00 2016 -0500
@@ -187,7 +187,12 @@
endif()
endif()
if(ARM AND CROSS_COMPILE_ARM)
- set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm)
+message(STATUS ${PLATFORM_LIBS})
+ if(APPLE)
+ #set(ARM_ARGS -arch armv7 -arch armv7s -arch arm64)
Min - did you mean to comment this out?
Yes, take it out now, it support iOS on different cpu, I find it from Apple SDK but I can't verify it now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20160701/bcb33c59/attachment.html>
More information about the x265-devel
mailing list