media/libyuv/libyuv.gyp

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 # Copyright 2011 The LibYuv Project Authors. All rights reserved.
michael@0 2 #
michael@0 3 # Use of this source code is governed by a BSD-style license
michael@0 4 # that can be found in the LICENSE file in the root of the source
michael@0 5 # tree. An additional intellectual property rights grant can be found
michael@0 6 # in the file PATENTS. All contributing project authors may
michael@0 7 # be found in the AUTHORS file in the root of the source tree.
michael@0 8
michael@0 9 {
michael@0 10 'includes': [
michael@0 11 'libyuv.gypi',
michael@0 12 ],
michael@0 13 'variables': {
michael@0 14 'use_system_libjpeg%': 0,
michael@0 15 'yuv_disable_asm%': 0,
michael@0 16 'yuv_disable_avx2%': 0,
michael@0 17 'build_neon': 0,
michael@0 18 'conditions': [
michael@0 19 ['target_arch == "arm" and arm_version >= 7 and (arm_neon == 1 or arm_neon_optional == 1)', {
michael@0 20 'build_neon': 1,
michael@0 21 }],
michael@0 22 ],
michael@0 23 },
michael@0 24 'conditions': [
michael@0 25 [ 'build_neon != 0', {
michael@0 26 'targets': [
michael@0 27 # The NEON-specific components.
michael@0 28 {
michael@0 29 'target_name': 'libyuv_neon',
michael@0 30 'type': 'static_library',
michael@0 31 'standalone_static_library': 1,
michael@0 32 'defines': [
michael@0 33 'LIBYUV_NEON',
michael@0 34 ],
michael@0 35 # TODO(noahric): This should remove whatever mfpu is set, not
michael@0 36 # just vfpv3-d16.
michael@0 37 'cflags!': [
michael@0 38 '-mfpu=vfp',
michael@0 39 '-mfpu=vfpv3',
michael@0 40 '-mfpu=vfpv3-d16',
michael@0 41 ],
michael@0 42 # XXX Doesn't work currently
michael@0 43 'cflags_mozilla!': [
michael@0 44 '-mfpu=vfp',
michael@0 45 '-mfpu=vfpv3',
michael@0 46 '-mfpu=vfpv3-d16',
michael@0 47 ],
michael@0 48 'cflags': [
michael@0 49 '-mfpu=neon',
michael@0 50 ],
michael@0 51 'cflags_mozilla': [
michael@0 52 '-mfpu=neon',
michael@0 53 ],
michael@0 54 'include_dirs': [
michael@0 55 'include',
michael@0 56 '.',
michael@0 57 ],
michael@0 58 'direct_dependent_settings': {
michael@0 59 'include_dirs': [
michael@0 60 'include',
michael@0 61 '.',
michael@0 62 ],
michael@0 63 },
michael@0 64 'sources': [
michael@0 65 # sources.
michael@0 66 'source/compare_neon.cc',
michael@0 67 'source/rotate_neon.cc',
michael@0 68 'source/row_neon.cc',
michael@0 69 'source/scale_neon.cc',
michael@0 70 ],
michael@0 71 },
michael@0 72 ],
michael@0 73 }],
michael@0 74 ],
michael@0 75 'targets': [
michael@0 76 {
michael@0 77 'target_name': 'libyuv',
michael@0 78 # Change type to 'shared_library' to build .so or .dll files.
michael@0 79 'type': 'static_library',
michael@0 80 # Allows libyuv.a redistributable library without external dependencies.
michael@0 81 # 'standalone_static_library': 1,
michael@0 82 'conditions': [
michael@0 83 # TODO(fbarchard): Use gyp define to enable jpeg.
michael@0 84 [ 'OS != "ios" and build_with_mozilla!=1', {
michael@0 85 'defines': [
michael@0 86 'HAVE_JPEG'
michael@0 87 ],
michael@0 88 'conditions': [
michael@0 89 # Android uses libjpeg for system jpeg support.
michael@0 90 [ 'OS == "android" and use_system_libjpeg == 1', {
michael@0 91 'dependencies': [
michael@0 92 '<(DEPTH)/third_party/libjpeg/libjpeg.gyp:libjpeg',
michael@0 93 ],
michael@0 94 }, {
michael@0 95 'dependencies': [
michael@0 96 '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp:libjpeg',
michael@0 97 ],
michael@0 98 }],
michael@0 99 [ 'use_system_libjpeg == 1', {
michael@0 100 'link_settings': {
michael@0 101 'libraries': [
michael@0 102 '-ljpeg',
michael@0 103 ],
michael@0 104 }
michael@0 105 }],
michael@0 106 ],
michael@0 107 }],
michael@0 108 [ 'build_neon != 0', {
michael@0 109 'dependencies': [
michael@0 110 'libyuv_neon',
michael@0 111 ],
michael@0 112 'defines': [
michael@0 113 'LIBYUV_NEON',
michael@0 114 ]
michael@0 115 }],
michael@0 116 [ 'yuv_disable_asm!=0', {
michael@0 117 'defines': [
michael@0 118 # Enable the following 3 macros to turn off assembly for specified CPU.
michael@0 119 'LIBYUV_DISABLE_X86',
michael@0 120 'LIBYUV_DISABLE_NEON',
michael@0 121 'LIBYUV_DISABLE_MIPS',
michael@0 122 ],
michael@0 123 }],
michael@0 124 [ 'yuv_disable_avx2==1', {
michael@0 125 'defines': [
michael@0 126 'LIBYUV_DISABLE_AVX2',
michael@0 127 ]
michael@0 128 }],
michael@0 129 ['build_with_mozilla==1', {
michael@0 130 'include_dirs': [
michael@0 131 '$(DEPTH)/dist/include',
michael@0 132 ],
michael@0 133 'direct_dependent_settings': {
michael@0 134 'include_dirs': [
michael@0 135 '$(DEPTH)/dist/include',
michael@0 136 ],
michael@0 137 },
michael@0 138 }],
michael@0 139 ],
michael@0 140 'defines': [
michael@0 141 # Enable the following 3 macros to turn off assembly for specified CPU.
michael@0 142 # 'LIBYUV_DISABLE_X86',
michael@0 143 # 'LIBYUV_DISABLE_NEON',
michael@0 144 # 'LIBYUV_DISABLE_MIPS',
michael@0 145 # This disables AVX2 (Haswell) support, overriding compiler checks
michael@0 146 # 'LIBYUV_DISABLE_AVX2',
michael@0 147 # Enable the following macro to build libyuv as a shared library (dll).
michael@0 148 # 'LIBYUV_USING_SHARED_LIBRARY',
michael@0 149 ],
michael@0 150 'include_dirs': [
michael@0 151 'include',
michael@0 152 '.',
michael@0 153 ],
michael@0 154 'direct_dependent_settings': {
michael@0 155 'include_dirs': [
michael@0 156 'include',
michael@0 157 '.',
michael@0 158 ],
michael@0 159 },
michael@0 160 'sources': [
michael@0 161 '<@(libyuv_sources)',
michael@0 162 ],
michael@0 163 },
michael@0 164 ], # targets.
michael@0 165 }
michael@0 166
michael@0 167 # Local Variables:
michael@0 168 # tab-width:2
michael@0 169 # indent-tabs-mode:nil
michael@0 170 # End:
michael@0 171 # vim: set expandtab tabstop=2 shiftwidth=2:

mercurial