Hendrik Dahlkamp | 33cfdeb | 2013-01-23 18:27:37 -0800 | [diff] [blame] | 1 | # Copyright 2011 The LibYuv Project Authors. All rights reserved. |
Shri Borde | 7cd8149 | 2011-11-02 13:20:24 -0700 | [diff] [blame] | 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 |
Hangyu Kuang | f047e7c | 2016-07-06 14:21:45 -0700 | [diff] [blame] | 6 | # in the file PATENTS. All contributing project authors may |
Shri Borde | 7cd8149 | 2011-11-02 13:20:24 -0700 | [diff] [blame] | 7 | # be found in the AUTHORS file in the root of the source tree. |
| 8 | |
| 9 | { |
Hangyu Kuang | f047e7c | 2016-07-06 14:21:45 -0700 | [diff] [blame] | 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', |
Hendrik Dahlkamp | 33cfdeb | 2013-01-23 18:27:37 -0800 | [diff] [blame] | 18 | }, |
Hangyu Kuang | f047e7c | 2016-07-06 14:21:45 -0700 | [diff] [blame] | 19 | 'variables': { |
| 20 | 'use_system_libjpeg%': 0, |
Frank Barchard | b83bb38 | 2017-02-22 18:01:07 -0800 | [diff] [blame] | 21 | # Can be enabled if your jpeg has GYP support. |
| 22 | 'libyuv_disable_jpeg%': 1, |
Hangyu Kuang | f047e7c | 2016-07-06 14:21:45 -0700 | [diff] [blame] | 23 | # 'chromium_code' treats libyuv as internal and increases warning level. |
| 24 | 'chromium_code': 1, |
| 25 | # clang compiler default variable usable by other apps that include libyuv. |
| 26 | 'clang%': 0, |
| 27 | # Link-Time Optimizations. |
| 28 | 'use_lto%': 0, |
Frank Barchard | b83bb38 | 2017-02-22 18:01:07 -0800 | [diff] [blame] | 29 | 'mips_msa%': 0, # Default to msa off. |
Hangyu Kuang | f047e7c | 2016-07-06 14:21:45 -0700 | [diff] [blame] | 30 | 'build_neon': 0, |
Frank Barchard | b83bb38 | 2017-02-22 18:01:07 -0800 | [diff] [blame] | 31 | 'build_msa': 0, |
Hangyu Kuang | f047e7c | 2016-07-06 14:21:45 -0700 | [diff] [blame] | 32 | 'conditions': [ |
| 33 | ['(target_arch == "armv7" or target_arch == "armv7s" or \ |
| 34 | (target_arch == "arm" and arm_version >= 7) or target_arch == "arm64")\ |
Frank Barchard | b83bb38 | 2017-02-22 18:01:07 -0800 | [diff] [blame] | 35 | and (arm_neon == 1 or arm_neon_optional == 1)', { |
Hangyu Kuang | f047e7c | 2016-07-06 14:21:45 -0700 | [diff] [blame] | 36 | 'build_neon': 1, |
| 37 | }], |
Frank Barchard | b83bb38 | 2017-02-22 18:01:07 -0800 | [diff] [blame] | 38 | ['(target_arch == "mipsel" or target_arch == "mips64el")\ |
| 39 | and (mips_msa == 1)', |
| 40 | { |
| 41 | 'build_msa': 1, |
| 42 | }], |
Hangyu Kuang | f047e7c | 2016-07-06 14:21:45 -0700 | [diff] [blame] | 43 | ], |
| 44 | }, |
| 45 | |
Shri Borde | 7cd8149 | 2011-11-02 13:20:24 -0700 | [diff] [blame] | 46 | 'targets': [ |
| 47 | { |
| 48 | 'target_name': 'libyuv', |
Hangyu Kuang | f047e7c | 2016-07-06 14:21:45 -0700 | [diff] [blame] | 49 | # Change type to 'shared_library' to build .so or .dll files. |
Shri Borde | 7cd8149 | 2011-11-02 13:20:24 -0700 | [diff] [blame] | 50 | 'type': 'static_library', |
Hangyu Kuang | f047e7c | 2016-07-06 14:21:45 -0700 | [diff] [blame] | 51 | 'variables': { |
| 52 | 'optimize': 'max', # enable O2 and ltcg. |
| 53 | }, |
| 54 | # Allows libyuv.a redistributable library without external dependencies. |
| 55 | 'standalone_static_library': 1, |
Hendrik Dahlkamp | 33cfdeb | 2013-01-23 18:27:37 -0800 | [diff] [blame] | 56 | 'conditions': [ |
Hangyu Kuang | f047e7c | 2016-07-06 14:21:45 -0700 | [diff] [blame] | 57 | # Disable -Wunused-parameter |
| 58 | ['clang == 1', { |
| 59 | 'cflags': [ |
| 60 | '-Wno-unused-parameter', |
| 61 | ], |
Hendrik Dahlkamp | 33cfdeb | 2013-01-23 18:27:37 -0800 | [diff] [blame] | 62 | }], |
Hangyu Kuang | f047e7c | 2016-07-06 14:21:45 -0700 | [diff] [blame] | 63 | ['build_neon != 0', { |
| 64 | 'defines': [ |
| 65 | 'LIBYUV_NEON', |
| 66 | ], |
| 67 | 'cflags!': [ |
| 68 | '-mfpu=vfp', |
| 69 | '-mfpu=vfpv3', |
| 70 | '-mfpu=vfpv3-d16', |
| 71 | # '-mthumb', # arm32 not thumb |
| 72 | ], |
| 73 | 'conditions': [ |
| 74 | # Disable LTO in libyuv_neon target due to gcc 4.9 compiler bug. |
| 75 | ['clang == 0 and use_lto == 1', { |
| 76 | 'cflags!': [ |
| 77 | '-flto', |
| 78 | '-ffat-lto-objects', |
| 79 | ], |
| 80 | }], |
| 81 | # arm64 does not need -mfpu=neon option as neon is not optional |
| 82 | ['target_arch != "arm64"', { |
| 83 | 'cflags': [ |
| 84 | '-mfpu=neon', |
| 85 | # '-marm', # arm32 not thumb |
| 86 | ], |
| 87 | }], |
| 88 | ], |
| 89 | }], |
Frank Barchard | b83bb38 | 2017-02-22 18:01:07 -0800 | [diff] [blame] | 90 | ['build_msa != 0', { |
| 91 | 'defines': [ |
| 92 | 'LIBYUV_MSA', |
| 93 | ], |
| 94 | }], |
Hangyu Kuang | f047e7c | 2016-07-06 14:21:45 -0700 | [diff] [blame] | 95 | ['OS != "ios" and libyuv_disable_jpeg != 1', { |
| 96 | 'defines': [ |
| 97 | 'HAVE_JPEG' |
| 98 | ], |
| 99 | 'conditions': [ |
| 100 | # Caveat system jpeg support may not support motion jpeg |
| 101 | [ 'use_system_libjpeg == 1', { |
| 102 | 'dependencies': [ |
| 103 | '<(DEPTH)/third_party/libjpeg/libjpeg.gyp:libjpeg', |
| 104 | ], |
| 105 | }, { |
| 106 | 'dependencies': [ |
| 107 | '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp:libjpeg', |
| 108 | ], |
| 109 | }], |
| 110 | [ 'use_system_libjpeg == 1', { |
| 111 | 'link_settings': { |
| 112 | 'libraries': [ |
| 113 | '-ljpeg', |
| 114 | ], |
| 115 | } |
| 116 | }], |
| 117 | ], |
| 118 | }], |
| 119 | ], #conditions |
Hendrik Dahlkamp | 33cfdeb | 2013-01-23 18:27:37 -0800 | [diff] [blame] | 120 | 'defines': [ |
Hangyu Kuang | f047e7c | 2016-07-06 14:21:45 -0700 | [diff] [blame] | 121 | # Enable the following 3 macros to turn off assembly for specified CPU. |
| 122 | # 'LIBYUV_DISABLE_X86', |
| 123 | # 'LIBYUV_DISABLE_NEON', |
Frank Barchard | b83bb38 | 2017-02-22 18:01:07 -0800 | [diff] [blame] | 124 | # 'LIBYUV_DISABLE_DSPR2', |
Hangyu Kuang | f047e7c | 2016-07-06 14:21:45 -0700 | [diff] [blame] | 125 | # Enable the following macro to build libyuv as a shared library (dll). |
| 126 | # 'LIBYUV_USING_SHARED_LIBRARY', |
| 127 | # TODO(fbarchard): Make these into gyp defines. |
Hendrik Dahlkamp | 33cfdeb | 2013-01-23 18:27:37 -0800 | [diff] [blame] | 128 | ], |
Shri Borde | 7cd8149 | 2011-11-02 13:20:24 -0700 | [diff] [blame] | 129 | 'include_dirs': [ |
Shri Borde | 7cd8149 | 2011-11-02 13:20:24 -0700 | [diff] [blame] | 130 | 'include', |
Hendrik Dahlkamp | 33cfdeb | 2013-01-23 18:27:37 -0800 | [diff] [blame] | 131 | '.', |
Shri Borde | 7cd8149 | 2011-11-02 13:20:24 -0700 | [diff] [blame] | 132 | ], |
| 133 | 'direct_dependent_settings': { |
| 134 | 'include_dirs': [ |
Shri Borde | 7cd8149 | 2011-11-02 13:20:24 -0700 | [diff] [blame] | 135 | 'include', |
Hendrik Dahlkamp | 33cfdeb | 2013-01-23 18:27:37 -0800 | [diff] [blame] | 136 | '.', |
Shri Borde | 7cd8149 | 2011-11-02 13:20:24 -0700 | [diff] [blame] | 137 | ], |
Hangyu Kuang | f047e7c | 2016-07-06 14:21:45 -0700 | [diff] [blame] | 138 | 'conditions': [ |
| 139 | ['OS == "android" and target_arch == "arm64"', { |
| 140 | 'ldflags': [ |
| 141 | '-Wl,--dynamic-linker,/system/bin/linker64', |
| 142 | ], |
| 143 | }], |
| 144 | ['OS == "android" and target_arch != "arm64"', { |
| 145 | 'ldflags': [ |
| 146 | '-Wl,--dynamic-linker,/system/bin/linker', |
| 147 | ], |
| 148 | }], |
| 149 | ], #conditions |
Shri Borde | 7cd8149 | 2011-11-02 13:20:24 -0700 | [diff] [blame] | 150 | }, |
| 151 | 'sources': [ |
Hangyu Kuang | f047e7c | 2016-07-06 14:21:45 -0700 | [diff] [blame] | 152 | '<@(libyuv_sources)', |
Shri Borde | 7cd8149 | 2011-11-02 13:20:24 -0700 | [diff] [blame] | 153 | ], |
Shri Borde | 7cd8149 | 2011-11-02 13:20:24 -0700 | [diff] [blame] | 154 | }, |
Hendrik Dahlkamp | 33cfdeb | 2013-01-23 18:27:37 -0800 | [diff] [blame] | 155 | ], # targets. |
Shri Borde | 7cd8149 | 2011-11-02 13:20:24 -0700 | [diff] [blame] | 156 | } |
| 157 | |
| 158 | # Local Variables: |
| 159 | # tab-width:2 |
| 160 | # indent-tabs-mode:nil |
| 161 | # End: |
| 162 | # vim: set expandtab tabstop=2 shiftwidth=2: |