• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
8
9{
10  'includes': [
11    'libyuv.gypi',
12  ],
13  # Make sure that if we are being compiled to an xcodeproj, nothing tries to
14  # include a .pch.
15  'xcode_settings': {
16    'GCC_PREFIX_HEADER': '',
17    'GCC_PRECOMPILE_PREFIX_HEADER': 'NO',
18  },
19  'variables': {
20    'use_system_libjpeg%': 0,
21    'libyuv_disable_jpeg%': 0,
22    # 'chromium_code' treats libyuv as internal and increases warning level.
23    'chromium_code': 1,
24    # clang compiler default variable usable by other apps that include libyuv.
25    'clang%': 0,
26    # Link-Time Optimizations.
27    'use_lto%': 0,
28    'build_neon': 0,
29    'conditions': [
30       ['(target_arch == "armv7" or target_arch == "armv7s" or \
31       (target_arch == "arm" and arm_version >= 7) or target_arch == "arm64")\
32       and (arm_neon == 1 or arm_neon_optional == 1)',
33       {
34         'build_neon': 1,
35       }],
36    ],
37  },
38
39  'targets': [
40    {
41      'target_name': 'libyuv',
42      # Change type to 'shared_library' to build .so or .dll files.
43      'type': 'static_library',
44      'variables': {
45        'optimize': 'max',  # enable O2 and ltcg.
46      },
47      # Allows libyuv.a redistributable library without external dependencies.
48      'standalone_static_library': 1,
49      'conditions': [
50       # Disable -Wunused-parameter
51        ['clang == 1', {
52          'cflags': [
53            '-Wno-unused-parameter',
54         ],
55        }],
56        ['build_neon != 0', {
57          'defines': [
58            'LIBYUV_NEON',
59          ],
60          'cflags!': [
61            '-mfpu=vfp',
62            '-mfpu=vfpv3',
63            '-mfpu=vfpv3-d16',
64            # '-mthumb',  # arm32 not thumb
65          ],
66          'conditions': [
67            # Disable LTO in libyuv_neon target due to gcc 4.9 compiler bug.
68            ['clang == 0 and use_lto == 1', {
69              'cflags!': [
70                '-flto',
71                '-ffat-lto-objects',
72              ],
73            }],
74            # arm64 does not need -mfpu=neon option as neon is not optional
75            ['target_arch != "arm64"', {
76              'cflags': [
77                '-mfpu=neon',
78                # '-marm',  # arm32 not thumb
79              ],
80            }],
81          ],
82        }],
83        ['OS != "ios" and libyuv_disable_jpeg != 1', {
84          'defines': [
85            'HAVE_JPEG'
86          ],
87          'conditions': [
88            # Caveat system jpeg support may not support motion jpeg
89            [ 'use_system_libjpeg == 1', {
90              'dependencies': [
91                 '<(DEPTH)/third_party/libjpeg/libjpeg.gyp:libjpeg',
92              ],
93            }, {
94              'dependencies': [
95                 '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp:libjpeg',
96              ],
97            }],
98            [ 'use_system_libjpeg == 1', {
99              'link_settings': {
100                'libraries': [
101                  '-ljpeg',
102                ],
103              }
104            }],
105          ],
106        }],
107      ], #conditions
108      'defines': [
109        # Enable the following 3 macros to turn off assembly for specified CPU.
110        # 'LIBYUV_DISABLE_X86',
111        # 'LIBYUV_DISABLE_NEON',
112        # 'LIBYUV_DISABLE_MIPS',
113        # Enable the following macro to build libyuv as a shared library (dll).
114        # 'LIBYUV_USING_SHARED_LIBRARY',
115        # TODO(fbarchard): Make these into gyp defines.
116      ],
117      'include_dirs': [
118        'include',
119        '.',
120      ],
121      'direct_dependent_settings': {
122        'include_dirs': [
123          'include',
124          '.',
125        ],
126        'conditions': [
127          ['OS == "android" and target_arch == "arm64"', {
128            'ldflags': [
129              '-Wl,--dynamic-linker,/system/bin/linker64',
130            ],
131          }],
132          ['OS == "android" and target_arch != "arm64"', {
133            'ldflags': [
134              '-Wl,--dynamic-linker,/system/bin/linker',
135            ],
136          }],
137        ], #conditions
138      },
139      'sources': [
140        '<@(libyuv_sources)',
141      ],
142    },
143  ], # targets.
144}
145
146# Local Variables:
147# tab-width:2
148# indent-tabs-mode:nil
149# End:
150# vim: set expandtab tabstop=2 shiftwidth=2:
151