From 0ba7b2394b0b6a31e43d323961ec63900079092c Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Tue, 7 Jan 2014 01:01:07 +0000 Subject: [PATCH] Build 2 libs - one with Neon and one without, then merge them together. Allows for a fat binary that runs on regular arm. BUG=298 TESTED=untested R=tomfinegan@chromium.org Review URL: https://webrtc-codereview.appspot.com/5169005 git-svn-id: http://libyuv.googlecode.com/svn/trunk@951 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- README.chromium | 2 +- include/libyuv/version.h | 2 +- libyuv.gyp | 63 ++++++++++++++++++++++++++++++++++++---- 3 files changed, 60 insertions(+), 7 deletions(-) diff --git a/README.chromium b/README.chromium index 586f93550..1d759a2b0 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 950 +Version: 951 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 9a2d799fb..7a4cc7e29 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 950 +#define LIBYUV_VERSION 951 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/libyuv.gyp b/libyuv.gyp index 3ce979278..56f9d3419 100644 --- a/libyuv.gyp +++ b/libyuv.gyp @@ -8,8 +8,57 @@ { 'variables': { - 'use_system_libjpeg%': 0, + 'use_system_libjpeg%': 0, + 'build_neon': 0, + 'conditions': [ + ['OS == "android" or OS == "ios"', { + # TODO(noahric): Also check tool version for armv7 + 'build_neon': 1, + }], + ], }, + 'conditions': [ + [ 'build_neon != 0', { + 'targets': [ + # The NEON-specific components. + { + 'target_name': 'libyuv_neon', + 'type': 'static_library', + 'standalone_static_library': 1, + 'defines': [ + 'LIBYUV_NEON', + ], + # TODO(noahric): This should remove whatever mfpu is set, not + # just vfpv3-d16. + 'cflags!': [ + '-mfpu=vfp', + '-mfpu=vfpv3', + '-mfpu=vfpv3-d16', + ], + 'cflags': [ + '-mfpu=neon', + ], + 'include_dirs': [ + 'include', + '.', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + 'include', + '.', + ], + }, + 'sources': [ + # sources. + 'source/compare_neon.cc', + 'source/rotate_neon.cc', + 'source/row_neon.cc', + 'source/scale_neon.cc', + ], + }, + ], + }], + ], 'targets': [ { 'target_name': 'libyuv', @@ -43,6 +92,14 @@ }], ], }], + [ 'build_neon != 0', { + 'dependencies': [ + 'libyuv_neon', + ], + 'defines': [ + 'LIBYUV_NEON', + ] + }], ], 'defines': [ # Enable the following 3 macros to turn off assembly for specified CPU. @@ -87,7 +144,6 @@ # sources. 'source/compare.cc', 'source/compare_common.cc', - 'source/compare_neon.cc', 'source/compare_posix.cc', 'source/compare_win.cc', 'source/convert.cc', @@ -105,18 +161,15 @@ 'source/rotate.cc', 'source/rotate_argb.cc', 'source/rotate_mips.cc', - 'source/rotate_neon.cc', 'source/row_any.cc', 'source/row_common.cc', 'source/row_mips.cc', - 'source/row_neon.cc', 'source/row_posix.cc', 'source/row_win.cc', 'source/scale.cc', 'source/scale_argb.cc', 'source/scale_common.cc', 'source/scale_mips.cc', - 'source/scale_neon.cc', 'source/scale_posix.cc', 'source/scale_win.cc', 'source/video_common.cc',