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

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

mercurial