blob: 246d662e1eb267840a375e5aecab112f46ccdc08 [file] [log] [blame]
fbarchard@google.comb0c97972012-08-08 19:04:24 +00001# Copyright 2011 The LibYuv Project Authors. All rights reserved.
mikhal@webrtc.orgaed1cc92011-09-28 00:06:25 +00002#
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
fbarchard@google.comcde58702013-01-28 00:02:35 +00006# in the file PATENTS. All contributing project authors may
mikhal@webrtc.orgaed1cc92011-09-28 00:06:25 +00007# be found in the AUTHORS file in the root of the source tree.
8
9{
sergeyu@google.com0d8da8a2014-01-14 01:01:19 +000010 'includes': [
11 'libyuv.gypi',
12 ],
fbarchard@google.com4f45c112012-07-24 18:32:05 +000013 'variables': {
fbarchard@google.com0ba7b232014-01-07 01:01:07 +000014 'use_system_libjpeg%': 0,
fbarchard@google.com455c66b2014-07-28 21:48:43 +000015 'libyuv_disable_jpeg%': 0,
fbarchard@google.com0ba7b232014-01-07 01:01:07 +000016 'build_neon': 0,
17 'conditions': [
fbarchard@google.comc99fa632014-03-29 00:19:06 +000018 [ '(target_arch == "armv7" or target_arch == "armv7s" or (target_arch == "arm" and arm_version >= 7)) and target_subarch != 64 and (arm_neon == 1 or arm_neon_optional == 1)', {
fbarchard@google.com0ba7b232014-01-07 01:01:07 +000019 'build_neon': 1,
20 }],
21 ],
fbarchard@google.com4f45c112012-07-24 18:32:05 +000022 },
fbarchard@google.com0ba7b232014-01-07 01:01:07 +000023 'conditions': [
24 [ 'build_neon != 0', {
25 'targets': [
26 # The NEON-specific components.
27 {
28 'target_name': 'libyuv_neon',
29 'type': 'static_library',
30 'standalone_static_library': 1,
fbarchard@google.com0ba7b232014-01-07 01:01:07 +000031 # TODO(noahric): This should remove whatever mfpu is set, not
32 # just vfpv3-d16.
33 'cflags!': [
34 '-mfpu=vfp',
35 '-mfpu=vfpv3',
36 '-mfpu=vfpv3-d16',
37 ],
38 'cflags': [
39 '-mfpu=neon',
40 ],
41 'include_dirs': [
42 'include',
43 '.',
44 ],
45 'direct_dependent_settings': {
46 'include_dirs': [
47 'include',
48 '.',
49 ],
50 },
51 'sources': [
52 # sources.
53 'source/compare_neon.cc',
54 'source/rotate_neon.cc',
55 'source/row_neon.cc',
56 'source/scale_neon.cc',
57 ],
58 },
59 ],
60 }],
61 ],
mikhal@webrtc.orgaed1cc92011-09-28 00:06:25 +000062 'targets': [
63 {
64 'target_name': 'libyuv',
fbarchard@google.com5ff0e972013-04-03 22:51:42 +000065 # Change type to 'shared_library' to build .so or .dll files.
mikhal@webrtc.orgaed1cc92011-09-28 00:06:25 +000066 'type': 'static_library',
fbarchard@google.com41541632013-05-01 19:14:28 +000067 # Allows libyuv.a redistributable library without external dependencies.
68 'standalone_static_library': 1,
fbarchard@google.com4f45c112012-07-24 18:32:05 +000069 'conditions': [
fbarchard@google.comc99fa632014-03-29 00:19:06 +000070 [ 'OS == "ios" and target_subarch == 64', {
71 'defines': [
72 'LIBYUV_DISABLE_NEON'
73 ],
74 }],
fbarchard@google.com455c66b2014-07-28 21:48:43 +000075 [ 'OS != "ios" and libyuv_disable_jpeg != 1', {
fbarchard@google.com5ff0e972013-04-03 22:51:42 +000076 'defines': [
77 'HAVE_JPEG'
fbarchard@google.com4f45c112012-07-24 18:32:05 +000078 ],
fbarchard@google.com5ff0e972013-04-03 22:51:42 +000079 'conditions': [
fbarchard@google.com9a462832014-01-18 02:07:16 +000080 # Caveat system jpeg support may not support motion jpeg
81 [ 'use_system_libjpeg == 1', {
fbarchard@google.com31ca8742013-12-13 00:25:28 +000082 'dependencies': [
83 '<(DEPTH)/third_party/libjpeg/libjpeg.gyp:libjpeg',
84 ],
85 }, {
fbarchard@google.com5ff0e972013-04-03 22:51:42 +000086 'dependencies': [
87 '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp:libjpeg',
88 ],
fbarchard@google.com31ca8742013-12-13 00:25:28 +000089 }],
90 [ 'use_system_libjpeg == 1', {
fbarchard@google.com5ff0e972013-04-03 22:51:42 +000091 'link_settings': {
92 'libraries': [
93 '-ljpeg',
94 ],
fbarchard@google.com31ca8742013-12-13 00:25:28 +000095 }
fbarchard@google.com5ff0e972013-04-03 22:51:42 +000096 }],
97 ],
fbarchard@google.com4f45c112012-07-24 18:32:05 +000098 }],
fbarchard@google.com0ba7b232014-01-07 01:01:07 +000099 [ 'build_neon != 0', {
100 'dependencies': [
101 'libyuv_neon',
102 ],
103 'defines': [
104 'LIBYUV_NEON',
105 ]
106 }],
kjellander@google.com10342772014-07-03 18:39:32 +0000107 # MemorySanitizer does not support assembly code yet.
108 # http://crbug.com/344505
109 [ 'msan == 1', {
110 'defines': [
111 'LIBYUV_DISABLE_X86',
112 ],
113 }],
fbarchard@google.com145998b2012-02-23 04:03:15 +0000114 ],
fbarchard@google.com2842f252012-02-22 18:52:29 +0000115 'defines': [
fbarchard@google.comf4951e72013-02-28 04:48:17 +0000116 # Enable the following 3 macros to turn off assembly for specified CPU.
fbarchard@google.com83a63e62013-02-27 00:20:29 +0000117 # 'LIBYUV_DISABLE_X86',
118 # 'LIBYUV_DISABLE_NEON',
119 # 'LIBYUV_DISABLE_MIPS',
fbarchard@google.comf4951e72013-02-28 04:48:17 +0000120 # Enable the following macro to build libyuv as a shared library (dll).
121 # 'LIBYUV_USING_SHARED_LIBRARY',
fbarchard@google.com2842f252012-02-22 18:52:29 +0000122 ],
mikhal@webrtc.orgaed1cc92011-09-28 00:06:25 +0000123 'include_dirs': [
mikhal@webrtc.orgd191b432011-10-07 20:00:23 +0000124 'include',
mikhal@webrtc.org82ca3952011-10-28 01:01:57 +0000125 '.',
mikhal@webrtc.orgaed1cc92011-09-28 00:06:25 +0000126 ],
mikhal@webrtc.orgd191b432011-10-07 20:00:23 +0000127 'direct_dependent_settings': {
128 'include_dirs': [
mikhal@webrtc.orgd191b432011-10-07 20:00:23 +0000129 'include',
mikhal@webrtc.org82ca3952011-10-28 01:01:57 +0000130 '.',
mikhal@webrtc.orgd191b432011-10-07 20:00:23 +0000131 ],
132 },
mikhal@webrtc.orgaed1cc92011-09-28 00:06:25 +0000133 'sources': [
sergeyu@google.com0d8da8a2014-01-14 01:01:19 +0000134 '<@(libyuv_sources)',
mikhal@webrtc.orgaed1cc92011-09-28 00:06:25 +0000135 ],
136 },
fbarchard@google.comd51c3422012-06-26 23:46:25 +0000137 ], # targets.
mikhal@webrtc.orgaed1cc92011-09-28 00:06:25 +0000138}
139
140# Local Variables:
141# tab-width:2
142# indent-tabs-mode:nil
143# End:
144# vim: set expandtab tabstop=2 shiftwidth=2: