epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 1 | { |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 2 | '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.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 23 | 'product_name': 'skia_opts', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 24 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 25 | 'standalone_static_library': 1, |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 26 | 'dependencies': [ |
| 27 | 'core.gyp:*', |
| 28 | ], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 29 | 'include_dirs': [ |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 30 | '../src/core', |
djsollen@google.com | a44e6c6 | 2012-01-09 14:38:25 +0000 | [diff] [blame] | 31 | '../src/opts', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 32 | ], |
| 33 | 'conditions': [ |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 34 | [ 'skia_arch_type == "x86" and skia_os != "ios"', { |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 35 | 'conditions': [ |
mtklein@google.com | d9d5c05 | 2013-07-31 20:09:25 +0000 | [diff] [blame] | 36 | [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos", "android"]', { |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 37 | 'cflags': [ |
| 38 | '-msse2', |
| 39 | ], |
| 40 | }], |
| 41 | ], |
humper@google.com | b088947 | 2013-07-09 21:37:14 +0000 | [diff] [blame] | 42 | 'include_dirs': [ |
| 43 | '../include/utils', |
| 44 | ], |
mtklein@google.com | d9d5c05 | 2013-07-31 20:09:25 +0000 | [diff] [blame] | 45 | 'dependencies': [ |
| 46 | 'opts_ssse3', |
| 47 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 48 | 'sources': [ |
djsollen@google.com | a44e6c6 | 2012-01-09 14:38:25 +0000 | [diff] [blame] | 49 | '../src/opts/opts_check_SSE2.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 50 | '../src/opts/SkBitmapProcState_opts_SSE2.cpp', |
humper@google.com | b088947 | 2013-07-09 21:37:14 +0000 | [diff] [blame] | 51 | '../src/opts/SkBitmapFilter_opts_SSE2.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 52 | '../src/opts/SkBlitRow_opts_SSE2.cpp', |
tomhudson@google.com | 8dd90a9 | 2012-03-19 13:49:50 +0000 | [diff] [blame] | 53 | '../src/opts/SkBlitRect_opts_SSE2.cpp', |
senorblanco@chromium.org | 7a47ad3 | 2013-10-30 21:57:04 +0000 | [diff] [blame] | 54 | '../src/opts/SkMorphology_opts_SSE2.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 55 | '../src/opts/SkUtils_opts_SSE2.cpp', |
commit-bot@chromium.org | df187c7 | 2013-10-09 14:39:46 +0000 | [diff] [blame] | 56 | '../src/opts/SkXfermode_opts_none.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 57 | ], |
| 58 | }], |
djsollen@google.com | f7542ba | 2013-07-31 12:57:27 +0000 | [diff] [blame] | 59 | [ 'skia_arch_type == "arm" and arm_version >= 7', { |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 60 | # The assembly uses the frame pointer register (r7 in Thumb/r11 in |
| 61 | # ARM), the compiler doesn't like that. |
| 62 | 'cflags!': [ |
| 63 | '-fno-omit-frame-pointer', |
djsollen@google.com | 5afbbc4 | 2012-11-29 15:09:58 +0000 | [diff] [blame] | 64 | '-mapcs-frame', |
| 65 | '-mapcs', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 66 | ], |
| 67 | 'cflags': [ |
| 68 | '-fomit-frame-pointer', |
djsollen@google.com | 5afbbc4 | 2012-11-29 15:09:58 +0000 | [diff] [blame] | 69 | '-mno-apcs-frame', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 70 | ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 71 | 'variables': { |
| 72 | 'arm_neon_optional%': '<(arm_neon_optional>', |
| 73 | }, |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 74 | 'sources': [ |
djsollen@google.com | a44e6c6 | 2012-01-09 14:38:25 +0000 | [diff] [blame] | 75 | '../src/opts/opts_check_arm.cpp', |
| 76 | '../src/opts/memset.arm.S', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 77 | '../src/opts/SkBitmapProcState_opts_arm.cpp', |
commit-bot@chromium.org | e997c26 | 2013-08-28 15:07:58 +0000 | [diff] [blame] | 78 | '../src/opts/SkBlitMask_opts_arm.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 79 | '../src/opts/SkBlitRow_opts_arm.cpp', |
digit@google.com | a8dd1ce | 2012-08-08 22:06:29 +0000 | [diff] [blame] | 80 | '../src/opts/SkBlitRow_opts_arm.h', |
senorblanco@chromium.org | 1986756 | 2013-10-30 22:38:15 +0000 | [diff] [blame] | 81 | '../src/opts/SkMorphology_opts_none.cpp', |
commit-bot@chromium.org | df187c7 | 2013-10-09 14:39:46 +0000 | [diff] [blame] | 82 | '../src/opts/SkXfermode_opts_arm.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 83 | ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 84 | 'conditions': [ |
| 85 | [ 'arm_neon == 1 or arm_neon_optional == 1', { |
| 86 | 'dependencies': [ |
| 87 | 'opts_neon', |
| 88 | ] |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 89 | }], |
| 90 | [ 'skia_os == "ios"', { |
| 91 | 'sources!': [ |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 92 | # these fail to compile under xcode for ios |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 93 | '../src/opts/memset.arm.S', |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 94 | '../src/opts/SkBitmapProcState_opts_arm.cpp', |
| 95 | '../src/opts/SkBlitRow_opts_arm.cpp', |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 96 | ], |
| 97 | }], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 98 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 99 | }], |
djsollen@google.com | f7542ba | 2013-07-31 12:57:27 +0000 | [diff] [blame] | 100 | [ '(skia_arch_type == "arm" and arm_version < 7) or (skia_os == "ios")', { |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 101 | 'sources': [ |
| 102 | '../src/opts/SkBitmapProcState_opts_none.cpp', |
commit-bot@chromium.org | e997c26 | 2013-08-28 15:07:58 +0000 | [diff] [blame] | 103 | '../src/opts/SkBlitMask_opts_none.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 104 | '../src/opts/SkBlitRow_opts_none.cpp', |
senorblanco@chromium.org | 7a47ad3 | 2013-10-30 21:57:04 +0000 | [diff] [blame] | 105 | '../src/opts/SkMorphology_opts_none.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 106 | '../src/opts/SkUtils_opts_none.cpp', |
commit-bot@chromium.org | df187c7 | 2013-10-09 14:39:46 +0000 | [diff] [blame] | 107 | '../src/opts/SkXfermode_opts_none.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 108 | ], |
| 109 | }], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 110 | ], |
| 111 | }, |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 112 | # For the same lame reasons as what is done for skia_opts, we have to |
| 113 | # create another target specifically for SSSE3 code as we would not want |
| 114 | # to compile the SSE2 code with -mssse3 which would potentially allow |
| 115 | # gcc to generate SSSE3 code. |
| 116 | { |
| 117 | 'target_name': 'opts_ssse3', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 118 | 'product_name': 'skia_opts_ssse3', |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 119 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 120 | 'standalone_static_library': 1, |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 121 | 'dependencies': [ |
| 122 | 'core.gyp:*', |
| 123 | ], |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 124 | 'include_dirs': [ |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 125 | '../src/core', |
| 126 | ], |
| 127 | 'conditions': [ |
mtklein@google.com | d9d5c05 | 2013-07-31 20:09:25 +0000 | [diff] [blame] | 128 | [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos", "android"]', { |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 129 | 'cflags': [ |
| 130 | '-mssse3', |
| 131 | ], |
| 132 | }], |
commit-bot@chromium.org | 4460de4 | 2013-08-06 18:13:01 +0000 | [diff] [blame] | 133 | # (Mac has -mssse3 globally.) |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 134 | [ 'skia_arch_type == "x86"', { |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 135 | 'sources': [ |
| 136 | '../src/opts/SkBitmapProcState_opts_SSSE3.cpp', |
| 137 | ], |
| 138 | }], |
| 139 | ], |
| 140 | }, |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 141 | # NEON code must be compiled with -mfpu=neon which also affects scalar |
| 142 | # code. To support dynamic NEON code paths, we need to build all |
| 143 | # NEON-specific sources in a separate static library. The situation |
| 144 | # is very similar to the SSSE3 one. |
| 145 | { |
| 146 | 'target_name': 'opts_neon', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 147 | 'product_name': 'skia_opts_neon', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 148 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 149 | 'standalone_static_library': 1, |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 150 | 'dependencies': [ |
| 151 | 'core.gyp:*', |
| 152 | ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 153 | 'include_dirs': [ |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 154 | '../src/core', |
digit@google.com | fce02ac | 2012-08-01 14:25:07 +0000 | [diff] [blame] | 155 | '../src/opts', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 156 | ], |
| 157 | 'cflags!': [ |
| 158 | '-fno-omit-frame-pointer', |
| 159 | '-mfpu=vfp', # remove them all, just in case. |
| 160 | '-mfpu=vfpv3', |
| 161 | '-mfpu=vfpv3-d16', |
| 162 | ], |
| 163 | 'cflags': [ |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 164 | '-mfpu=neon', |
digit@google.com | fce02ac | 2012-08-01 14:25:07 +0000 | [diff] [blame] | 165 | '-fomit-frame-pointer', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 166 | ], |
djsollen@google.com | 4dcc624 | 2013-01-23 18:56:38 +0000 | [diff] [blame] | 167 | 'ldflags': [ |
| 168 | '-march=armv7-a', |
| 169 | '-Wl,--fix-cortex-a8', |
| 170 | ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 171 | 'sources': [ |
| 172 | '../src/opts/memset16_neon.S', |
| 173 | '../src/opts/memset32_neon.S', |
digit@google.com | 3ada0ef | 2012-08-13 14:06:34 +0000 | [diff] [blame] | 174 | '../src/opts/SkBitmapProcState_arm_neon.cpp', |
digit@google.com | fce02ac | 2012-08-01 14:25:07 +0000 | [diff] [blame] | 175 | '../src/opts/SkBitmapProcState_matrixProcs_neon.cpp', |
| 176 | '../src/opts/SkBitmapProcState_matrix_clamp_neon.h', |
| 177 | '../src/opts/SkBitmapProcState_matrix_repeat_neon.h', |
digit@google.com | a8dd1ce | 2012-08-08 22:06:29 +0000 | [diff] [blame] | 178 | '../src/opts/SkBlitRow_opts_arm_neon.cpp', |
commit-bot@chromium.org | cd7992b | 2013-10-17 16:29:34 +0000 | [diff] [blame] | 179 | '../src/opts/SkXfermode_opts_arm_neon.cpp', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 180 | ], |
| 181 | }, |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 182 | ], |
| 183 | } |
| 184 | |
| 185 | # Local Variables: |
| 186 | # tab-width:2 |
| 187 | # indent-tabs-mode:nil |
| 188 | # End: |
| 189 | # vim: set expandtab tabstop=2 shiftwidth=2: |