OLD | NEW |
1 # Copyright 2011 The LibYuv Project Authors. All rights reserved. | 1 # Copyright 2011 The LibYuv Project Authors. All rights reserved. |
2 # | 2 # |
3 # Use of this source code is governed by a BSD-style license | 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 | 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 | 5 # tree. An additional intellectual property rights grant can be found |
6 # in the file PATENTS. All contributing project authors may | 6 # in the file PATENTS. All contributing project authors may |
7 # be found in the AUTHORS file in the root of the source tree. | 7 # be found in the AUTHORS file in the root of the source tree. |
8 | 8 |
9 { | 9 { |
10 'includes': [ | 10 'includes': [ |
(...skipping 15 matching lines...) Expand all Loading... |
26 'build_neon': 0, | 26 'build_neon': 0, |
27 'conditions': [ | 27 'conditions': [ |
28 ['(target_arch == "armv7" or target_arch == "armv7s" or \ | 28 ['(target_arch == "armv7" or target_arch == "armv7s" or \ |
29 (target_arch == "arm" and arm_version >= 7) or target_arch == "arm64")\ | 29 (target_arch == "arm" and arm_version >= 7) or target_arch == "arm64")\ |
30 and (arm_neon == 1 or arm_neon_optional == 1)', | 30 and (arm_neon == 1 or arm_neon_optional == 1)', |
31 { | 31 { |
32 'build_neon': 1, | 32 'build_neon': 1, |
33 }], | 33 }], |
34 ], | 34 ], |
35 }, | 35 }, |
36 'conditions': [ | 36 |
37 ['build_neon != 0', { | 37 'targets': [ |
38 'targets': [ | 38 { |
39 # The NEON-specific components. | 39 'target_name': 'libyuv', |
40 { | 40 # Change type to 'shared_library' to build .so or .dll files. |
41 'target_name': 'libyuv_neon', | 41 'type': 'static_library', |
42 'type': 'static_library', | 42 'variables': { |
43 'standalone_static_library': 1, | 43 'optimize': 'max', # enable O2 and ltcg. |
44 # TODO(noahric): This should remove whatever mfpu is set, not | 44 }, |
45 # just vfpv3-d16. | 45 # Allows libyuv.a redistributable library without external dependencies. |
| 46 'standalone_static_library': 1, |
| 47 'conditions': [ |
| 48 ['build_neon != 0', { |
| 49 'defines': [ |
| 50 'LIBYUV_NEON', |
| 51 ], |
46 'cflags!': [ | 52 'cflags!': [ |
47 '-mfpu=vfp', | 53 '-mfpu=vfp', |
48 '-mfpu=vfpv3', | 54 '-mfpu=vfpv3', |
49 '-mfpu=vfpv3-d16', | 55 '-mfpu=vfpv3-d16', |
50 ], | 56 ], |
51 'conditions': [ | 57 'conditions': [ |
52 # Disable LTO in libyuv_neon target due to gcc 4.9 compiler bug. | 58 # Disable LTO in libyuv_neon target due to gcc 4.9 compiler bug. |
53 ['clang == 0 and use_lto == 1', { | 59 ['clang == 0 and use_lto == 1', { |
54 'cflags!': [ | 60 'cflags!': [ |
55 '-flto', | 61 '-flto', |
56 '-ffat-lto-objects', | 62 '-ffat-lto-objects', |
57 ], | 63 ], |
58 }], | 64 }], |
59 # arm64 does not need -mfpu=neon option as neon is not optional | 65 # arm64 does not need -mfpu=neon option as neon is not optional |
60 ['target_arch != "arm64"', { | 66 ['target_arch != "arm64"', { |
61 'cflags': [ | 67 'cflags': [ |
62 '-mfpu=neon', | 68 '-mfpu=neon', |
63 ], | 69 ], |
64 }], | 70 }], |
65 ], | 71 ], |
66 'include_dirs': [ | 72 }], |
67 'include', | |
68 '.', | |
69 ], | |
70 'direct_dependent_settings': { | |
71 'include_dirs': [ | |
72 'include', | |
73 '.', | |
74 ], | |
75 }, | |
76 'sources': [ | |
77 # sources. | |
78 'source/compare_neon.cc', | |
79 'source/compare_neon64.cc', | |
80 'source/rotate_neon.cc', | |
81 'source/rotate_neon64.cc', | |
82 'source/row_neon.cc', | |
83 'source/row_neon64.cc', | |
84 'source/scale_neon.cc', | |
85 'source/scale_neon64.cc', | |
86 ], | |
87 }, | |
88 ], | |
89 }], | |
90 ], | |
91 'targets': [ | |
92 { | |
93 'target_name': 'libyuv', | |
94 # Change type to 'shared_library' to build .so or .dll files. | |
95 'type': 'static_library', | |
96 'variables': { | |
97 'optimize': 'max', # enable O2 and ltcg. | |
98 }, | |
99 # Allows libyuv.a redistributable library without external dependencies. | |
100 'standalone_static_library': 1, | |
101 'conditions': [ | |
102 ['OS != "ios" and libyuv_disable_jpeg != 1', { | 73 ['OS != "ios" and libyuv_disable_jpeg != 1', { |
103 'defines': [ | 74 'defines': [ |
104 'HAVE_JPEG' | 75 'HAVE_JPEG' |
105 ], | 76 ], |
106 'conditions': [ | 77 'conditions': [ |
107 # Caveat system jpeg support may not support motion jpeg | 78 # Caveat system jpeg support may not support motion jpeg |
108 [ 'use_system_libjpeg == 1', { | 79 [ 'use_system_libjpeg == 1', { |
109 'dependencies': [ | 80 'dependencies': [ |
110 '<(DEPTH)/third_party/libjpeg/libjpeg.gyp:libjpeg', | 81 '<(DEPTH)/third_party/libjpeg/libjpeg.gyp:libjpeg', |
111 ], | 82 ], |
112 }, { | 83 }, { |
113 'dependencies': [ | 84 'dependencies': [ |
114 '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp:libjpeg', | 85 '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp:libjpeg', |
115 ], | 86 ], |
116 }], | 87 }], |
117 [ 'use_system_libjpeg == 1', { | 88 [ 'use_system_libjpeg == 1', { |
118 'link_settings': { | 89 'link_settings': { |
119 'libraries': [ | 90 'libraries': [ |
120 '-ljpeg', | 91 '-ljpeg', |
121 ], | 92 ], |
122 } | 93 } |
123 }], | 94 }], |
124 ], | 95 ], |
125 }], | 96 }], |
126 ['build_neon != 0', { | |
127 'dependencies': [ | |
128 'libyuv_neon', | |
129 ], | |
130 'defines': [ | |
131 'LIBYUV_NEON', | |
132 ], | |
133 }], | |
134 # MemorySanitizer does not support assembly code yet. | 97 # MemorySanitizer does not support assembly code yet. |
135 # http://crbug.com/344505 | 98 # http://crbug.com/344505 |
136 [ 'msan == 1', { | 99 [ 'msan == 1', { |
137 'defines': [ | 100 'defines': [ |
138 'LIBYUV_DISABLE_X86', | 101 'LIBYUV_DISABLE_X86', |
139 ], | 102 ], |
140 }], | 103 }], |
141 ], #conditions | 104 ], #conditions |
142 'defines': [ | 105 'defines': [ |
143 # Enable the following 3 macros to turn off assembly for specified CPU. | 106 # Enable the following 3 macros to turn off assembly for specified CPU. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 ], | 138 ], |
176 }, | 139 }, |
177 ], # targets. | 140 ], # targets. |
178 } | 141 } |
179 | 142 |
180 # Local Variables: | 143 # Local Variables: |
181 # tab-width:2 | 144 # tab-width:2 |
182 # indent-tabs-mode:nil | 145 # indent-tabs-mode:nil |
183 # End: | 146 # End: |
184 # vim: set expandtab tabstop=2 shiftwidth=2: | 147 # vim: set expandtab tabstop=2 shiftwidth=2: |
OLD | NEW |