blob: 04966ba67b201fad41afb4150eacee4d6fc32527 [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,
bungeman@google.comb8f36552013-07-22 14:39:45 +000026 'dependencies': [
27 'core.gyp:*',
28 ],
epoger@google.comae85aea2011-05-31 13:50:51 +000029 'include_dirs': [
epoger@google.comae85aea2011-05-31 13:50:51 +000030 '../src/core',
djsollen@google.coma44e6c62012-01-09 14:38:25 +000031 '../src/opts',
epoger@google.comae85aea2011-05-31 13:50:51 +000032 ],
33 'conditions': [
caryclark@google.com867cbd82012-09-20 15:45:41 +000034 [ 'skia_arch_type == "x86" and skia_os != "ios"', {
tomhudson@google.com95ad1552012-02-14 18:28:54 +000035 'conditions': [
mtklein@google.comd9d5c052013-07-31 20:09:25 +000036 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos", "android"]', {
tomhudson@google.com95ad1552012-02-14 18:28:54 +000037 'cflags': [
38 '-msse2',
39 ],
40 }],
41 ],
humper@google.comb0889472013-07-09 21:37:14 +000042 'include_dirs': [
43 '../include/utils',
44 ],
mtklein@google.comd9d5c052013-07-31 20:09:25 +000045 'dependencies': [
46 'opts_ssse3',
47 ],
djsollen@google.com58629292011-11-03 13:08:29 +000048 'sources': [
djsollen@google.coma44e6c62012-01-09 14:38:25 +000049 '../src/opts/opts_check_SSE2.cpp',
djsollen@google.com58629292011-11-03 13:08:29 +000050 '../src/opts/SkBitmapProcState_opts_SSE2.cpp',
humper@google.comb0889472013-07-09 21:37:14 +000051 '../src/opts/SkBitmapFilter_opts_SSE2.cpp',
djsollen@google.com58629292011-11-03 13:08:29 +000052 '../src/opts/SkBlitRow_opts_SSE2.cpp',
tomhudson@google.com8dd90a92012-03-19 13:49:50 +000053 '../src/opts/SkBlitRect_opts_SSE2.cpp',
djsollen@google.com58629292011-11-03 13:08:29 +000054 '../src/opts/SkUtils_opts_SSE2.cpp',
commit-bot@chromium.orgdf187c72013-10-09 14:39:46 +000055 '../src/opts/SkXfermode_opts_none.cpp',
djsollen@google.com58629292011-11-03 13:08:29 +000056 ],
57 }],
djsollen@google.comf7542ba2013-07-31 12:57:27 +000058 [ 'skia_arch_type == "arm" and arm_version >= 7', {
djsollen@google.com58629292011-11-03 13:08:29 +000059 # The assembly uses the frame pointer register (r7 in Thumb/r11 in
60 # ARM), the compiler doesn't like that.
61 'cflags!': [
62 '-fno-omit-frame-pointer',
djsollen@google.com5afbbc42012-11-29 15:09:58 +000063 '-mapcs-frame',
64 '-mapcs',
djsollen@google.com58629292011-11-03 13:08:29 +000065 ],
66 'cflags': [
67 '-fomit-frame-pointer',
djsollen@google.com5afbbc42012-11-29 15:09:58 +000068 '-mno-apcs-frame',
djsollen@google.com58629292011-11-03 13:08:29 +000069 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +000070 'variables': {
71 'arm_neon_optional%': '<(arm_neon_optional>',
72 },
djsollen@google.com58629292011-11-03 13:08:29 +000073 'sources': [
djsollen@google.coma44e6c62012-01-09 14:38:25 +000074 '../src/opts/opts_check_arm.cpp',
75 '../src/opts/memset.arm.S',
djsollen@google.com58629292011-11-03 13:08:29 +000076 '../src/opts/SkBitmapProcState_opts_arm.cpp',
commit-bot@chromium.orge997c262013-08-28 15:07:58 +000077 '../src/opts/SkBlitMask_opts_arm.cpp',
djsollen@google.com58629292011-11-03 13:08:29 +000078 '../src/opts/SkBlitRow_opts_arm.cpp',
digit@google.coma8dd1ce2012-08-08 22:06:29 +000079 '../src/opts/SkBlitRow_opts_arm.h',
commit-bot@chromium.orgdf187c72013-10-09 14:39:46 +000080 '../src/opts/SkXfermode_opts_arm.cpp',
djsollen@google.com58629292011-11-03 13:08:29 +000081 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +000082 'conditions': [
83 [ 'arm_neon == 1 or arm_neon_optional == 1', {
84 'dependencies': [
85 'opts_neon',
86 ]
caryclark@google.com867cbd82012-09-20 15:45:41 +000087 }],
88 [ 'skia_os == "ios"', {
89 'sources!': [
caryclark@google.com594dd3c2012-09-24 19:33:57 +000090 # these fail to compile under xcode for ios
caryclark@google.com867cbd82012-09-20 15:45:41 +000091 '../src/opts/memset.arm.S',
caryclark@google.com594dd3c2012-09-24 19:33:57 +000092 '../src/opts/SkBitmapProcState_opts_arm.cpp',
93 '../src/opts/SkBlitRow_opts_arm.cpp',
caryclark@google.com867cbd82012-09-20 15:45:41 +000094 ],
95 }],
digit@google.comeec9dbc2012-05-30 13:54:41 +000096 ],
djsollen@google.com58629292011-11-03 13:08:29 +000097 }],
djsollen@google.comf7542ba2013-07-31 12:57:27 +000098 [ '(skia_arch_type == "arm" and arm_version < 7) or (skia_os == "ios")', {
djsollen@google.com58629292011-11-03 13:08:29 +000099 'sources': [
100 '../src/opts/SkBitmapProcState_opts_none.cpp',
commit-bot@chromium.orge997c262013-08-28 15:07:58 +0000101 '../src/opts/SkBlitMask_opts_none.cpp',
djsollen@google.com58629292011-11-03 13:08:29 +0000102 '../src/opts/SkBlitRow_opts_none.cpp',
103 '../src/opts/SkUtils_opts_none.cpp',
commit-bot@chromium.orgdf187c72013-10-09 14:39:46 +0000104 '../src/opts/SkXfermode_opts_none.cpp',
djsollen@google.com58629292011-11-03 13:08:29 +0000105 ],
106 }],
epoger@google.comae85aea2011-05-31 13:50:51 +0000107 ],
108 },
tomhudson@google.com95ad1552012-02-14 18:28:54 +0000109 # For the same lame reasons as what is done for skia_opts, we have to
110 # create another target specifically for SSSE3 code as we would not want
111 # to compile the SSE2 code with -mssse3 which would potentially allow
112 # gcc to generate SSSE3 code.
113 {
114 'target_name': 'opts_ssse3',
borenet@google.comefb1d772012-10-10 19:45:51 +0000115 'product_name': 'skia_opts_ssse3',
tomhudson@google.com95ad1552012-02-14 18:28:54 +0000116 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +0000117 'standalone_static_library': 1,
bungeman@google.comb8f36552013-07-22 14:39:45 +0000118 'dependencies': [
119 'core.gyp:*',
120 ],
tomhudson@google.com95ad1552012-02-14 18:28:54 +0000121 'include_dirs': [
tomhudson@google.com95ad1552012-02-14 18:28:54 +0000122 '../src/core',
123 ],
124 'conditions': [
mtklein@google.comd9d5c052013-07-31 20:09:25 +0000125 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos", "android"]', {
tomhudson@google.com95ad1552012-02-14 18:28:54 +0000126 'cflags': [
127 '-mssse3',
128 ],
129 }],
commit-bot@chromium.org4460de42013-08-06 18:13:01 +0000130 # (Mac has -mssse3 globally.)
djsollen@google.come341cb32012-06-28 16:08:05 +0000131 [ 'skia_arch_type == "x86"', {
tomhudson@google.com95ad1552012-02-14 18:28:54 +0000132 'sources': [
133 '../src/opts/SkBitmapProcState_opts_SSSE3.cpp',
134 ],
135 }],
136 ],
137 },
digit@google.comeec9dbc2012-05-30 13:54:41 +0000138 # NEON code must be compiled with -mfpu=neon which also affects scalar
139 # code. To support dynamic NEON code paths, we need to build all
140 # NEON-specific sources in a separate static library. The situation
141 # is very similar to the SSSE3 one.
142 {
143 'target_name': 'opts_neon',
borenet@google.comefb1d772012-10-10 19:45:51 +0000144 'product_name': 'skia_opts_neon',
digit@google.comeec9dbc2012-05-30 13:54:41 +0000145 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +0000146 'standalone_static_library': 1,
bungeman@google.comb8f36552013-07-22 14:39:45 +0000147 'dependencies': [
148 'core.gyp:*',
149 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000150 'include_dirs': [
digit@google.comeec9dbc2012-05-30 13:54:41 +0000151 '../src/core',
digit@google.comfce02ac2012-08-01 14:25:07 +0000152 '../src/opts',
digit@google.comeec9dbc2012-05-30 13:54:41 +0000153 ],
154 'cflags!': [
155 '-fno-omit-frame-pointer',
156 '-mfpu=vfp', # remove them all, just in case.
157 '-mfpu=vfpv3',
158 '-mfpu=vfpv3-d16',
159 ],
160 'cflags': [
digit@google.comeec9dbc2012-05-30 13:54:41 +0000161 '-mfpu=neon',
digit@google.comfce02ac2012-08-01 14:25:07 +0000162 '-fomit-frame-pointer',
digit@google.comeec9dbc2012-05-30 13:54:41 +0000163 ],
djsollen@google.com4dcc6242013-01-23 18:56:38 +0000164 'ldflags': [
165 '-march=armv7-a',
166 '-Wl,--fix-cortex-a8',
167 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000168 'sources': [
169 '../src/opts/memset16_neon.S',
170 '../src/opts/memset32_neon.S',
digit@google.com3ada0ef2012-08-13 14:06:34 +0000171 '../src/opts/SkBitmapProcState_arm_neon.cpp',
digit@google.comfce02ac2012-08-01 14:25:07 +0000172 '../src/opts/SkBitmapProcState_matrixProcs_neon.cpp',
173 '../src/opts/SkBitmapProcState_matrix_clamp_neon.h',
174 '../src/opts/SkBitmapProcState_matrix_repeat_neon.h',
digit@google.coma8dd1ce2012-08-08 22:06:29 +0000175 '../src/opts/SkBlitRow_opts_arm_neon.cpp',
digit@google.comeec9dbc2012-05-30 13:54:41 +0000176 ],
177 },
epoger@google.comae85aea2011-05-31 13:50:51 +0000178 ],
179}
180
181# Local Variables:
182# tab-width:2
183# indent-tabs-mode:nil
184# End:
185# vim: set expandtab tabstop=2 shiftwidth=2: