scroggo@google.com | d4adfa3 | 2014-02-05 16:35:12 +0000 | [diff] [blame] | 1 | # Gyp file for opts projects |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 2 | { |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 3 | 'targets': [ |
| 4 | # Due to an unfortunate intersection of lameness between gcc and gyp, |
| 5 | # we have to build the *_SSE2.cpp files in a separate target. The |
| 6 | # gcc lameness is that, in order to compile SSE2 intrinsics code, it |
| 7 | # must be passed the -msse2 flag. However, with this flag, it may |
| 8 | # emit SSE2 instructions even for scalar code, such as the CPUID |
| 9 | # test used to test for the presence of SSE2. So that, and all other |
| 10 | # code must be compiled *without* -msse2. The gyp lameness is that it |
| 11 | # does not allow file-specific CFLAGS, so we must create this extra |
| 12 | # target for those files to be compiled with -msse2. |
| 13 | # |
| 14 | # This is actually only a problem on 32-bit Linux (all Intel Macs have |
| 15 | # SSE2, Linux x86_64 has SSE2 by definition, and MSC will happily emit |
| 16 | # SSE2 from instrinsics, while generating plain ol' 386 for everything |
| 17 | # else). However, to keep the .gyp file simple and avoid platform-specific |
| 18 | # build breakage, we do this on all platforms. |
| 19 | |
| 20 | # For about the same reason, we need to compile the ARM opts files |
| 21 | # separately as well. |
| 22 | { |
| 23 | 'target_name': 'opts', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 24 | 'product_name': 'skia_opts', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 25 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 26 | 'standalone_static_library': 1, |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 27 | 'dependencies': [ |
| 28 | 'core.gyp:*', |
senorblanco@chromium.org | 0ded88d | 2014-01-24 15:43:50 +0000 | [diff] [blame] | 29 | 'effects.gyp:*' |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 30 | ], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 31 | 'include_dirs': [ |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 32 | '../src/core', |
djsollen@google.com | a44e6c6 | 2012-01-09 14:38:25 +0000 | [diff] [blame] | 33 | '../src/opts', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 34 | ], |
| 35 | 'conditions': [ |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 36 | [ 'skia_arch_type == "x86" and skia_os != "ios"', { |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 37 | 'conditions': [ |
mtklein@google.com | d9d5c05 | 2013-07-31 20:09:25 +0000 | [diff] [blame] | 38 | [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos", "android"]', { |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 39 | 'cflags': [ |
| 40 | '-msse2', |
| 41 | ], |
| 42 | }], |
| 43 | ], |
humper@google.com | b088947 | 2013-07-09 21:37:14 +0000 | [diff] [blame] | 44 | 'include_dirs': [ |
| 45 | '../include/utils', |
| 46 | ], |
mtklein@google.com | d9d5c05 | 2013-07-31 20:09:25 +0000 | [diff] [blame] | 47 | 'dependencies': [ |
| 48 | 'opts_ssse3', |
| 49 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 50 | 'sources': [ |
commit-bot@chromium.org | 8c4953c | 2014-04-30 14:58:46 +0000 | [diff] [blame] | 51 | '../src/opts/opts_check_x86.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 52 | '../src/opts/SkBitmapProcState_opts_SSE2.cpp', |
humper@google.com | b088947 | 2013-07-09 21:37:14 +0000 | [diff] [blame] | 53 | '../src/opts/SkBitmapFilter_opts_SSE2.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 54 | '../src/opts/SkBlitRow_opts_SSE2.cpp', |
tomhudson@google.com | 8dd90a9 | 2012-03-19 13:49:50 +0000 | [diff] [blame] | 55 | '../src/opts/SkBlitRect_opts_SSE2.cpp', |
senorblanco@chromium.org | 27eec46 | 2013-11-08 20:49:04 +0000 | [diff] [blame] | 56 | '../src/opts/SkBlurImage_opts_SSE2.cpp', |
senorblanco@chromium.org | 7a47ad3 | 2013-10-30 21:57:04 +0000 | [diff] [blame] | 57 | '../src/opts/SkMorphology_opts_SSE2.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 58 | '../src/opts/SkUtils_opts_SSE2.cpp', |
commit-bot@chromium.org | c524e98 | 2014-04-09 15:43:46 +0000 | [diff] [blame] | 59 | '../src/opts/SkXfermode_opts_SSE2.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 60 | ], |
| 61 | }], |
djsollen@google.com | f7542ba | 2013-07-31 12:57:27 +0000 | [diff] [blame] | 62 | [ 'skia_arch_type == "arm" and arm_version >= 7', { |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 63 | # The assembly uses the frame pointer register (r7 in Thumb/r11 in |
| 64 | # ARM), the compiler doesn't like that. |
| 65 | 'cflags!': [ |
| 66 | '-fno-omit-frame-pointer', |
djsollen@google.com | 5afbbc4 | 2012-11-29 15:09:58 +0000 | [diff] [blame] | 67 | '-mapcs-frame', |
| 68 | '-mapcs', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 69 | ], |
| 70 | 'cflags': [ |
| 71 | '-fomit-frame-pointer', |
djsollen@google.com | 5afbbc4 | 2012-11-29 15:09:58 +0000 | [diff] [blame] | 72 | '-mno-apcs-frame', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 73 | ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 74 | 'variables': { |
| 75 | 'arm_neon_optional%': '<(arm_neon_optional>', |
| 76 | }, |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 77 | 'sources': [ |
djsollen@google.com | a44e6c6 | 2012-01-09 14:38:25 +0000 | [diff] [blame] | 78 | '../src/opts/memset.arm.S', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 79 | '../src/opts/SkBitmapProcState_opts_arm.cpp', |
commit-bot@chromium.org | e997c26 | 2013-08-28 15:07:58 +0000 | [diff] [blame] | 80 | '../src/opts/SkBlitMask_opts_arm.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 81 | '../src/opts/SkBlitRow_opts_arm.cpp', |
commit-bot@chromium.org | 5764165 | 2014-02-10 15:01:05 +0000 | [diff] [blame] | 82 | '../src/opts/SkBlurImage_opts_arm.cpp', |
| 83 | '../src/opts/SkMorphology_opts_arm.cpp', |
| 84 | '../src/opts/SkUtils_opts_arm.cpp', |
commit-bot@chromium.org | df187c7 | 2013-10-09 14:39:46 +0000 | [diff] [blame] | 85 | '../src/opts/SkXfermode_opts_arm.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 86 | ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 87 | 'conditions': [ |
| 88 | [ 'arm_neon == 1 or arm_neon_optional == 1', { |
| 89 | 'dependencies': [ |
| 90 | 'opts_neon', |
| 91 | ] |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 92 | }], |
| 93 | [ 'skia_os == "ios"', { |
| 94 | 'sources!': [ |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 95 | # these fail to compile under xcode for ios |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 96 | '../src/opts/memset.arm.S', |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 97 | '../src/opts/SkBitmapProcState_opts_arm.cpp', |
| 98 | '../src/opts/SkBlitRow_opts_arm.cpp', |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 99 | ], |
| 100 | }], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 101 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 102 | }], |
djordje.pesut | 632a454 | 2014-06-11 06:56:10 -0700 | [diff] [blame^] | 103 | [ 'skia_arch_type == "mips"', { |
| 104 | 'sources': [ |
| 105 | '../src/opts/SkBitmapProcState_opts_none.cpp', |
| 106 | '../src/opts/SkBlitMask_opts_none.cpp', |
| 107 | '../src/opts/SkBlurImage_opts_none.cpp', |
| 108 | '../src/opts/SkMorphology_opts_none.cpp', |
| 109 | '../src/opts/SkUtils_opts_none.cpp', |
| 110 | '../src/opts/SkXfermode_opts_none.cpp', |
| 111 | ], |
| 112 | 'conditions': [ |
| 113 | [ '(mips_arch_variant == "mips32r2") \ |
| 114 | and (mips_dsp == 1 or mips_dsp == 2)', { |
| 115 | 'sources': [ |
| 116 | '../src/opts/SkBlitRow_opts_mips_dsp.cpp', |
| 117 | ], |
| 118 | }, { |
| 119 | 'sources': [ |
| 120 | '../src/opts/SkBlitRow_opts_none.cpp', |
| 121 | ], |
| 122 | }], |
| 123 | ], |
| 124 | }], |
| 125 | [ '(skia_arch_type == "arm" and arm_version < 7) \ |
scroggo@google.com | d4adfa3 | 2014-02-05 16:35:12 +0000 | [diff] [blame] | 126 | or (skia_os == "ios") \ |
commit-bot@chromium.org | ab08437 | 2014-05-22 13:42:34 +0000 | [diff] [blame] | 127 | or (skia_os == "android" and skia_arch_type not in ["x86", "arm", "mips", "arm64"])', { |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 128 | 'sources': [ |
| 129 | '../src/opts/SkBitmapProcState_opts_none.cpp', |
commit-bot@chromium.org | e997c26 | 2013-08-28 15:07:58 +0000 | [diff] [blame] | 130 | '../src/opts/SkBlitMask_opts_none.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 131 | '../src/opts/SkBlitRow_opts_none.cpp', |
senorblanco@chromium.org | 27eec46 | 2013-11-08 20:49:04 +0000 | [diff] [blame] | 132 | '../src/opts/SkBlurImage_opts_none.cpp', |
senorblanco@chromium.org | 7a47ad3 | 2013-10-30 21:57:04 +0000 | [diff] [blame] | 133 | '../src/opts/SkMorphology_opts_none.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 134 | '../src/opts/SkUtils_opts_none.cpp', |
commit-bot@chromium.org | df187c7 | 2013-10-09 14:39:46 +0000 | [diff] [blame] | 135 | '../src/opts/SkXfermode_opts_none.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 136 | ], |
| 137 | }], |
commit-bot@chromium.org | e72a408 | 2014-02-28 16:07:39 +0000 | [diff] [blame] | 138 | [ 'skia_android_framework', { |
| 139 | 'cflags!': [ |
| 140 | '-msse2', |
| 141 | '-mfpu=neon', |
| 142 | '-fomit-frame-pointer', |
| 143 | '-mno-apcs-frame', |
| 144 | ] |
| 145 | }], |
commit-bot@chromium.org | ab08437 | 2014-05-22 13:42:34 +0000 | [diff] [blame] | 146 | [ 'skia_arch_type == "arm64"', { |
commit-bot@chromium.org | 6f2d4d4 | 2014-04-02 15:03:56 +0000 | [diff] [blame] | 147 | 'sources': [ |
| 148 | '../src/opts/SkBitmapProcState_arm_neon.cpp', |
| 149 | '../src/opts/SkBitmapProcState_matrixProcs_neon.cpp', |
| 150 | '../src/opts/SkBitmapProcState_opts_arm.cpp', |
| 151 | '../src/opts/SkBlitMask_opts_arm.cpp', |
| 152 | '../src/opts/SkBlitMask_opts_arm_neon.cpp', |
kevin.petit | 866b95d | 2014-06-03 10:08:07 -0700 | [diff] [blame] | 153 | '../src/opts/SkBlitRow_opts_arm.cpp', |
| 154 | '../src/opts/SkBlitRow_opts_arm_neon.cpp', |
commit-bot@chromium.org | 6f2d4d4 | 2014-04-02 15:03:56 +0000 | [diff] [blame] | 155 | '../src/opts/SkBlurImage_opts_arm.cpp', |
| 156 | '../src/opts/SkBlurImage_opts_neon.cpp', |
| 157 | '../src/opts/SkMorphology_opts_arm.cpp', |
| 158 | '../src/opts/SkMorphology_opts_neon.cpp', |
| 159 | '../src/opts/SkUtils_opts_none.cpp', |
| 160 | '../src/opts/SkXfermode_opts_arm.cpp', |
| 161 | '../src/opts/SkXfermode_opts_arm_neon.cpp', |
| 162 | ], |
| 163 | }], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 164 | ], |
| 165 | }, |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 166 | # For the same lame reasons as what is done for skia_opts, we have to |
| 167 | # create another target specifically for SSSE3 code as we would not want |
| 168 | # to compile the SSE2 code with -mssse3 which would potentially allow |
| 169 | # gcc to generate SSSE3 code. |
| 170 | { |
| 171 | 'target_name': 'opts_ssse3', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 172 | 'product_name': 'skia_opts_ssse3', |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 173 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 174 | 'standalone_static_library': 1, |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 175 | 'dependencies': [ |
| 176 | 'core.gyp:*', |
senorblanco@chromium.org | 0ded88d | 2014-01-24 15:43:50 +0000 | [diff] [blame] | 177 | 'effects.gyp:*' |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 178 | ], |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 179 | 'include_dirs': [ |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 180 | '../src/core', |
| 181 | ], |
| 182 | 'conditions': [ |
commit-bot@chromium.org | e72a408 | 2014-02-28 16:07:39 +0000 | [diff] [blame] | 183 | [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos", "android"] \ |
| 184 | and not skia_android_framework', { |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 185 | 'cflags': [ |
| 186 | '-mssse3', |
| 187 | ], |
| 188 | }], |
commit-bot@chromium.org | 4460de4 | 2013-08-06 18:13:01 +0000 | [diff] [blame] | 189 | # (Mac has -mssse3 globally.) |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 190 | [ 'skia_arch_type == "x86"', { |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 191 | 'sources': [ |
| 192 | '../src/opts/SkBitmapProcState_opts_SSSE3.cpp', |
| 193 | ], |
| 194 | }], |
| 195 | ], |
| 196 | }, |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 197 | # NEON code must be compiled with -mfpu=neon which also affects scalar |
| 198 | # code. To support dynamic NEON code paths, we need to build all |
| 199 | # NEON-specific sources in a separate static library. The situation |
jvanverth | 71804cc | 2014-06-05 08:19:23 -0700 | [diff] [blame] | 200 | # is very similar to the SSSE3 one. |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 201 | { |
| 202 | 'target_name': 'opts_neon', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 203 | 'product_name': 'skia_opts_neon', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 204 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 205 | 'standalone_static_library': 1, |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 206 | 'dependencies': [ |
| 207 | 'core.gyp:*', |
senorblanco@chromium.org | 0ded88d | 2014-01-24 15:43:50 +0000 | [diff] [blame] | 208 | 'effects.gyp:*' |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 209 | ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 210 | 'include_dirs': [ |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 211 | '../src/core', |
digit@google.com | fce02ac | 2012-08-01 14:25:07 +0000 | [diff] [blame] | 212 | '../src/opts', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 213 | ], |
| 214 | 'cflags!': [ |
| 215 | '-fno-omit-frame-pointer', |
| 216 | '-mfpu=vfp', # remove them all, just in case. |
| 217 | '-mfpu=vfpv3', |
| 218 | '-mfpu=vfpv3-d16', |
| 219 | ], |
commit-bot@chromium.org | e72a408 | 2014-02-28 16:07:39 +0000 | [diff] [blame] | 220 | 'conditions': [ |
| 221 | [ 'not skia_android_framework', { |
| 222 | 'cflags': [ |
| 223 | '-mfpu=neon', |
| 224 | '-fomit-frame-pointer', |
| 225 | ], |
| 226 | }], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 227 | ], |
djsollen@google.com | 4dcc624 | 2013-01-23 18:56:38 +0000 | [diff] [blame] | 228 | 'ldflags': [ |
| 229 | '-march=armv7-a', |
| 230 | '-Wl,--fix-cortex-a8', |
| 231 | ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 232 | 'sources': [ |
| 233 | '../src/opts/memset16_neon.S', |
| 234 | '../src/opts/memset32_neon.S', |
digit@google.com | 3ada0ef | 2012-08-13 14:06:34 +0000 | [diff] [blame] | 235 | '../src/opts/SkBitmapProcState_arm_neon.cpp', |
digit@google.com | fce02ac | 2012-08-01 14:25:07 +0000 | [diff] [blame] | 236 | '../src/opts/SkBitmapProcState_matrixProcs_neon.cpp', |
commit-bot@chromium.org | a96176d | 2014-01-28 15:18:54 +0000 | [diff] [blame] | 237 | '../src/opts/SkBitmapProcState_matrix_neon.h', |
rmistry@google.com | d6bab02 | 2013-12-02 13:50:38 +0000 | [diff] [blame] | 238 | '../src/opts/SkBlitMask_opts_arm_neon.cpp', |
digit@google.com | a8dd1ce | 2012-08-08 22:06:29 +0000 | [diff] [blame] | 239 | '../src/opts/SkBlitRow_opts_arm_neon.cpp', |
senorblanco@chromium.org | 1d62f42 | 2013-12-04 18:19:45 +0000 | [diff] [blame] | 240 | '../src/opts/SkBlurImage_opts_neon.cpp', |
senorblanco@chromium.org | f376f5d | 2013-11-11 16:48:51 +0000 | [diff] [blame] | 241 | '../src/opts/SkMorphology_opts_neon.cpp', |
commit-bot@chromium.org | cd7992b | 2013-10-17 16:29:34 +0000 | [diff] [blame] | 242 | '../src/opts/SkXfermode_opts_arm_neon.cpp', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 243 | ], |
| 244 | }, |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 245 | ], |
| 246 | } |