blob: b8d7e22960ed1410e92bf31a386d72eb70c83e8f [file] [log] [blame]
epoger@google.comae85aea2011-05-31 13:50:51 +00001{
epoger@google.comae85aea2011-05-31 13:50:51 +00002 'targets': [
3 # Due to an unfortunate intersection of lameness between gcc and gyp,
4 # we have to build the *_SSE2.cpp files in a separate target. The
5 # gcc lameness is that, in order to compile SSE2 intrinsics code, it
6 # must be passed the -msse2 flag. However, with this flag, it may
7 # emit SSE2 instructions even for scalar code, such as the CPUID
8 # test used to test for the presence of SSE2. So that, and all other
9 # code must be compiled *without* -msse2. The gyp lameness is that it
10 # does not allow file-specific CFLAGS, so we must create this extra
11 # target for those files to be compiled with -msse2.
12 #
13 # This is actually only a problem on 32-bit Linux (all Intel Macs have
14 # SSE2, Linux x86_64 has SSE2 by definition, and MSC will happily emit
15 # SSE2 from instrinsics, while generating plain ol' 386 for everything
16 # else). However, to keep the .gyp file simple and avoid platform-specific
17 # build breakage, we do this on all platforms.
18
19 # For about the same reason, we need to compile the ARM opts files
20 # separately as well.
21 {
22 'target_name': 'opts',
borenet@google.comefb1d772012-10-10 19:45:51 +000023 'product_name': 'skia_opts',
epoger@google.comae85aea2011-05-31 13:50:51 +000024 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +000025 'standalone_static_library': 1,
epoger@google.comae85aea2011-05-31 13:50:51 +000026 'include_dirs': [
27 '../include/config',
28 '../include/core',
29 '../src/core',
djsollen@google.coma44e6c62012-01-09 14:38:25 +000030 '../src/opts',
epoger@google.comae85aea2011-05-31 13:50:51 +000031 ],
32 'conditions': [
caryclark@google.com867cbd82012-09-20 15:45:41 +000033 [ 'skia_arch_type == "x86" and skia_os != "ios"', {
tomhudson@google.com95ad1552012-02-14 18:28:54 +000034 'conditions': [
35 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
36 'cflags': [
37 '-msse2',
38 ],
39 }],
40 ],
djsollen@google.com58629292011-11-03 13:08:29 +000041 'sources': [
djsollen@google.coma44e6c62012-01-09 14:38:25 +000042 '../src/opts/opts_check_SSE2.cpp',
djsollen@google.com58629292011-11-03 13:08:29 +000043 '../src/opts/SkBitmapProcState_opts_SSE2.cpp',
44 '../src/opts/SkBlitRow_opts_SSE2.cpp',
tomhudson@google.com8dd90a92012-03-19 13:49:50 +000045 '../src/opts/SkBlitRect_opts_SSE2.cpp',
djsollen@google.com58629292011-11-03 13:08:29 +000046 '../src/opts/SkUtils_opts_SSE2.cpp',
47 ],
tomhudson@google.com95ad1552012-02-14 18:28:54 +000048 'dependencies': [
49 'opts_ssse3',
50 ],
djsollen@google.com58629292011-11-03 13:08:29 +000051 }],
djsollen@google.come341cb32012-06-28 16:08:05 +000052 [ 'skia_arch_type == "arm" and armv7 == 1', {
djsollen@google.com58629292011-11-03 13:08:29 +000053 # The assembly uses the frame pointer register (r7 in Thumb/r11 in
54 # ARM), the compiler doesn't like that.
55 'cflags!': [
56 '-fno-omit-frame-pointer',
57 ],
58 'cflags': [
59 '-fomit-frame-pointer',
60 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +000061 'variables': {
62 'arm_neon_optional%': '<(arm_neon_optional>',
63 },
djsollen@google.com58629292011-11-03 13:08:29 +000064 'sources': [
djsollen@google.coma44e6c62012-01-09 14:38:25 +000065 '../src/opts/opts_check_arm.cpp',
66 '../src/opts/memset.arm.S',
djsollen@google.com58629292011-11-03 13:08:29 +000067 '../src/opts/SkBitmapProcState_opts_arm.cpp',
68 '../src/opts/SkBlitRow_opts_arm.cpp',
digit@google.coma8dd1ce2012-08-08 22:06:29 +000069 '../src/opts/SkBlitRow_opts_arm.h',
djsollen@google.com58629292011-11-03 13:08:29 +000070 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +000071 'conditions': [
72 [ 'arm_neon == 1 or arm_neon_optional == 1', {
73 'dependencies': [
74 'opts_neon',
75 ]
caryclark@google.com867cbd82012-09-20 15:45:41 +000076 }],
77 [ 'skia_os == "ios"', {
78 'sources!': [
caryclark@google.com594dd3c2012-09-24 19:33:57 +000079 # these fail to compile under xcode for ios
caryclark@google.com867cbd82012-09-20 15:45:41 +000080 '../src/opts/memset.arm.S',
caryclark@google.com594dd3c2012-09-24 19:33:57 +000081 '../src/opts/SkBitmapProcState_opts_arm.cpp',
82 '../src/opts/SkBlitRow_opts_arm.cpp',
caryclark@google.com867cbd82012-09-20 15:45:41 +000083 ],
84 }],
digit@google.comeec9dbc2012-05-30 13:54:41 +000085 ],
djsollen@google.com58629292011-11-03 13:08:29 +000086 }],
caryclark@google.com594dd3c2012-09-24 19:33:57 +000087 [ '(skia_arch_type == "arm" and armv7 == 0) or (skia_os == "ios")', {
djsollen@google.com58629292011-11-03 13:08:29 +000088 'sources': [
89 '../src/opts/SkBitmapProcState_opts_none.cpp',
90 '../src/opts/SkBlitRow_opts_none.cpp',
91 '../src/opts/SkUtils_opts_none.cpp',
92 ],
93 }],
epoger@google.comae85aea2011-05-31 13:50:51 +000094 ],
95 },
tomhudson@google.com95ad1552012-02-14 18:28:54 +000096 # For the same lame reasons as what is done for skia_opts, we have to
97 # create another target specifically for SSSE3 code as we would not want
98 # to compile the SSE2 code with -mssse3 which would potentially allow
99 # gcc to generate SSSE3 code.
100 {
101 'target_name': 'opts_ssse3',
borenet@google.comefb1d772012-10-10 19:45:51 +0000102 'product_name': 'skia_opts_ssse3',
tomhudson@google.com95ad1552012-02-14 18:28:54 +0000103 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +0000104 'standalone_static_library': 1,
tomhudson@google.com95ad1552012-02-14 18:28:54 +0000105 'include_dirs': [
106 '../include/config',
107 '../include/core',
108 '../src/core',
109 ],
110 'conditions': [
epoger@google.com21099232012-02-14 19:49:19 +0000111 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
tomhudson@google.com95ad1552012-02-14 18:28:54 +0000112 'cflags': [
113 '-mssse3',
114 ],
115 }],
epoger@google.com21099232012-02-14 19:49:19 +0000116 # TODO(epoger): the following will enable SSSE3 on Macs, but it will
117 # break once we set OTHER_CFLAGS anywhere else (the first setting will
118 # be replaced, not added to)
119 [ 'skia_os in ["mac"]', {
120 'xcode_settings': {
121 'OTHER_CFLAGS': ['-mssse3',],
122 },
123 }],
djsollen@google.come341cb32012-06-28 16:08:05 +0000124 [ 'skia_arch_type == "x86"', {
tomhudson@google.com95ad1552012-02-14 18:28:54 +0000125 'sources': [
126 '../src/opts/SkBitmapProcState_opts_SSSE3.cpp',
127 ],
128 }],
129 ],
130 },
digit@google.comeec9dbc2012-05-30 13:54:41 +0000131 # NEON code must be compiled with -mfpu=neon which also affects scalar
132 # code. To support dynamic NEON code paths, we need to build all
133 # NEON-specific sources in a separate static library. The situation
134 # is very similar to the SSSE3 one.
135 {
136 'target_name': 'opts_neon',
borenet@google.comefb1d772012-10-10 19:45:51 +0000137 'product_name': 'skia_opts_neon',
digit@google.comeec9dbc2012-05-30 13:54:41 +0000138 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +0000139 'standalone_static_library': 1,
digit@google.comeec9dbc2012-05-30 13:54:41 +0000140 'include_dirs': [
141 '../include/config',
142 '../include/core',
143 '../src/core',
digit@google.comfce02ac2012-08-01 14:25:07 +0000144 '../src/opts',
digit@google.comeec9dbc2012-05-30 13:54:41 +0000145 ],
146 'cflags!': [
147 '-fno-omit-frame-pointer',
148 '-mfpu=vfp', # remove them all, just in case.
149 '-mfpu=vfpv3',
150 '-mfpu=vfpv3-d16',
151 ],
152 'cflags': [
digit@google.comeec9dbc2012-05-30 13:54:41 +0000153 '-mfpu=neon',
digit@google.comfce02ac2012-08-01 14:25:07 +0000154 '-fomit-frame-pointer',
digit@google.comeec9dbc2012-05-30 13:54:41 +0000155 ],
156 'sources': [
157 '../src/opts/memset16_neon.S',
158 '../src/opts/memset32_neon.S',
digit@google.com3ada0ef2012-08-13 14:06:34 +0000159 '../src/opts/SkBitmapProcState_arm_neon.cpp',
digit@google.comfce02ac2012-08-01 14:25:07 +0000160 '../src/opts/SkBitmapProcState_matrixProcs_neon.cpp',
161 '../src/opts/SkBitmapProcState_matrix_clamp_neon.h',
162 '../src/opts/SkBitmapProcState_matrix_repeat_neon.h',
digit@google.coma8dd1ce2012-08-08 22:06:29 +0000163 '../src/opts/SkBlitRow_opts_arm_neon.cpp',
digit@google.comeec9dbc2012-05-30 13:54:41 +0000164 ],
165 },
epoger@google.comae85aea2011-05-31 13:50:51 +0000166 ],
167}
168
169# Local Variables:
170# tab-width:2
171# indent-tabs-mode:nil
172# End:
173# vim: set expandtab tabstop=2 shiftwidth=2: