scroggo | 3e56227 | 2015-03-25 10:22:41 -0700 | [diff] [blame] | 1 | # Copyright 2015 Google Inc. |
| 2 | # |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
scroggo | df1c337 | 2015-02-12 10:48:25 -0800 | [diff] [blame] | 5 | # Gyp file for building opts target. |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 6 | { |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 7 | # Source lists live in opts.gypi. This makes it easier to maintain our Chrome GYP/GN setup. |
| 8 | # (To be honest, I'm not sure why we need to include common.gypi. I thought it was automatic.) |
| 9 | 'variables': { |
| 10 | 'includes': [ 'common.gypi', 'opts.gypi' ], |
| 11 | }, |
mtklein | 0933725 | 2015-01-26 18:15:31 -0800 | [diff] [blame] | 12 | |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 13 | # Generally we shove things into one 'opts' target conditioned on platform. |
| 14 | # If a particular platform needs some files built with different flags, |
| 15 | # those become separate targets: opts_ssse3, opts_sse41, opts_neon. |
| 16 | |
| 17 | 'targets': [ |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 18 | { |
| 19 | 'target_name': 'opts', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 20 | 'product_name': 'skia_opts', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 21 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 22 | 'standalone_static_library': 1, |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 23 | 'dependencies': [ |
| 24 | 'core.gyp:*', |
senorblanco@chromium.org | 0ded88d | 2014-01-24 15:43:50 +0000 | [diff] [blame] | 25 | 'effects.gyp:*' |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 26 | ], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 27 | 'include_dirs': [ |
mtklein | cd1f2da | 2015-07-28 08:55:14 -0700 | [diff] [blame] | 28 | '../include/private', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 29 | '../src/core', |
djsollen@google.com | a44e6c6 | 2012-01-09 14:38:25 +0000 | [diff] [blame] | 30 | '../src/opts', |
krajcevski | 630598c | 2014-07-14 12:00:04 -0700 | [diff] [blame] | 31 | '../src/utils', |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 32 | '../include/utils', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 33 | ], |
| 34 | 'conditions': [ |
scroggo | df1c337 | 2015-02-12 10:48:25 -0800 | [diff] [blame] | 35 | [ '"x86" in skia_arch_type and skia_os != "ios"', { |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 36 | 'cflags': [ '-msse2' ], |
mtklein | 5141d90 | 2015-08-24 10:32:02 -0700 | [diff] [blame] | 37 | 'dependencies': [ 'opts_ssse3', 'opts_sse41', 'opts_sse42', 'opts_avx', 'opts_avx2' ], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 38 | 'sources': [ '<@(sse2_sources)' ], |
mtklein | c98fe3a | 2015-01-26 18:05:37 -0800 | [diff] [blame] | 39 | }], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 40 | |
| 41 | [ 'skia_arch_type == "mips"', { |
| 42 | 'conditions': [ |
| 43 | [ '(mips_arch_variant == "mips32r2") and (mips_dsp == 1 or mips_dsp == 2)', { |
| 44 | 'sources': [ '<@(mips_dsp_sources)' ], |
| 45 | },{ |
| 46 | 'sources': [ '<@(none_sources)' ], |
| 47 | }], |
| 48 | ] |
| 49 | }], |
| 50 | |
| 51 | [ '(skia_arch_type == "arm" and arm_version < 7) \ |
mtklein | f3f9440 | 2015-04-17 14:02:40 -0700 | [diff] [blame] | 52 | or (skia_os == "ios") \ |
scroggo | df1c337 | 2015-02-12 10:48:25 -0800 | [diff] [blame] | 53 | or (skia_os == "android" \ |
mtklein | f3f9440 | 2015-04-17 14:02:40 -0700 | [diff] [blame] | 54 | and skia_arch_type not in ["x86", "x86_64", "arm", "mips", \ |
| 55 | "arm64"])', { |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 56 | 'sources': [ '<@(none_sources)' ], |
| 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. |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 62 | 'cflags!': [ '-fno-omit-frame-pointer', '-mapcs-frame', '-mapcs' ], |
| 63 | 'cflags': [ '-fomit-frame-pointer' ], |
| 64 | 'variables': { 'arm_neon_optional%': '<(arm_neon_optional>' }, |
| 65 | 'sources': [ '<@(armv7_sources)' ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 66 | 'conditions': [ |
| 67 | [ 'arm_neon == 1 or arm_neon_optional == 1', { |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 68 | 'dependencies': [ 'opts_neon' ] |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 69 | }], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 70 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 71 | }], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 72 | |
| 73 | [ 'skia_arch_type == "arm64"', { |
| 74 | 'sources': [ '<@(arm64_sources)' ], |
djordje.pesut | 632a454 | 2014-06-11 06:56:10 -0700 | [diff] [blame] | 75 | }], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 76 | |
commit-bot@chromium.org | e72a408 | 2014-02-28 16:07:39 +0000 | [diff] [blame] | 77 | [ 'skia_android_framework', { |
| 78 | 'cflags!': [ |
| 79 | '-msse2', |
| 80 | '-mfpu=neon', |
| 81 | '-fomit-frame-pointer', |
commit-bot@chromium.org | e72a408 | 2014-02-28 16:07:39 +0000 | [diff] [blame] | 82 | ] |
| 83 | }], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 84 | ], |
| 85 | }, |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 86 | { |
| 87 | 'target_name': 'opts_ssse3', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 88 | 'product_name': 'skia_opts_ssse3', |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 89 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 90 | 'standalone_static_library': 1, |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 91 | 'dependencies': [ 'core.gyp:*' ], |
mtklein | cd1f2da | 2015-07-28 08:55:14 -0700 | [diff] [blame] | 92 | 'include_dirs': [ |
| 93 | '../include/private', |
| 94 | '../src/core', |
mtklein | b639474 | 2015-08-06 08:17:16 -0700 | [diff] [blame] | 95 | '../src/utils', |
mtklein | cd1f2da | 2015-07-28 08:55:14 -0700 | [diff] [blame] | 96 | ], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 97 | 'sources': [ '<@(ssse3_sources)' ], |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 98 | 'conditions': [ |
mtklein | 8553396 | 2015-08-25 06:30:07 -0700 | [diff] [blame] | 99 | [ 'skia_os == "win"', { 'defines' : [ 'SK_CPU_SSE_LEVEL=31' ] }], |
| 100 | [ 'not skia_android_framework', { 'cflags': [ '-mssse3' ] }], |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 101 | ], |
| 102 | }, |
henrik.smiding | 3bb195e | 2014-06-27 08:03:17 -0700 | [diff] [blame] | 103 | { |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 104 | 'target_name': 'opts_sse41', |
| 105 | 'product_name': 'skia_opts_sse41', |
henrik.smiding | 3bb195e | 2014-06-27 08:03:17 -0700 | [diff] [blame] | 106 | 'type': 'static_library', |
| 107 | 'standalone_static_library': 1, |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 108 | 'dependencies': [ 'core.gyp:*' ], |
mtklein | cd1f2da | 2015-07-28 08:55:14 -0700 | [diff] [blame] | 109 | 'include_dirs': [ |
| 110 | '../include/private', |
| 111 | '../src/core', |
mtklein | b639474 | 2015-08-06 08:17:16 -0700 | [diff] [blame] | 112 | '../src/utils', |
mtklein | cd1f2da | 2015-07-28 08:55:14 -0700 | [diff] [blame] | 113 | ], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 114 | 'sources': [ '<@(sse41_sources)' ], |
mtklein | 8553396 | 2015-08-25 06:30:07 -0700 | [diff] [blame] | 115 | 'xcode_settings': { 'GCC_ENABLE_SSE41_EXTENSIONS': 'YES' }, |
henrik.smiding | 3bb195e | 2014-06-27 08:03:17 -0700 | [diff] [blame] | 116 | 'conditions': [ |
mtklein | 8553396 | 2015-08-25 06:30:07 -0700 | [diff] [blame] | 117 | [ 'skia_os == "win"', { 'defines' : [ 'SK_CPU_SSE_LEVEL=41' ] }], |
| 118 | [ 'not skia_android_framework', { 'cflags': [ '-msse4.1' ] }], |
henrik.smiding | 3bb195e | 2014-06-27 08:03:17 -0700 | [diff] [blame] | 119 | ], |
| 120 | }, |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 121 | { |
mtklein | 5141d90 | 2015-08-24 10:32:02 -0700 | [diff] [blame] | 122 | 'target_name': 'opts_sse42', |
| 123 | 'product_name': 'skia_opts_sse42', |
| 124 | 'type': 'static_library', |
| 125 | 'standalone_static_library': 1, |
| 126 | 'dependencies': [ 'core.gyp:*' ], |
| 127 | 'include_dirs': [ |
| 128 | '../include/private', |
| 129 | '../src/core', |
| 130 | '../src/utils', |
| 131 | ], |
| 132 | 'sources': [ '<@(sse42_sources)' ], |
mtklein | 8553396 | 2015-08-25 06:30:07 -0700 | [diff] [blame] | 133 | 'xcode_settings': { 'GCC_ENABLE_SSE42_EXTENSIONS': 'YES' }, |
mtklein | 5141d90 | 2015-08-24 10:32:02 -0700 | [diff] [blame] | 134 | 'conditions': [ |
mtklein | 8553396 | 2015-08-25 06:30:07 -0700 | [diff] [blame] | 135 | [ 'skia_os == "win"', { 'defines' : [ 'SK_CPU_SSE_LEVEL=42' ] }], |
| 136 | [ 'not skia_android_framework', { 'cflags': [ '-msse4.2' ] }], |
mtklein | 5141d90 | 2015-08-24 10:32:02 -0700 | [diff] [blame] | 137 | ], |
| 138 | }, |
| 139 | { |
| 140 | 'target_name': 'opts_avx', |
| 141 | 'product_name': 'skia_opts_avx', |
| 142 | 'type': 'static_library', |
| 143 | 'standalone_static_library': 1, |
| 144 | 'dependencies': [ 'core.gyp:*' ], |
| 145 | 'include_dirs': [ |
| 146 | '../include/private', |
| 147 | '../src/core', |
| 148 | '../src/utils', |
| 149 | ], |
| 150 | 'sources': [ '<@(avx_sources)' ], |
mtklein | 8553396 | 2015-08-25 06:30:07 -0700 | [diff] [blame] | 151 | 'msvs_settings': { 'VCCLCompilerTool': { 'EnableEnhancedInstructionSet': '3' } }, |
| 152 | 'xcode_settings': { 'OTHER_CFLAGS': [ '-mavx' ] }, |
mtklein | 5141d90 | 2015-08-24 10:32:02 -0700 | [diff] [blame] | 153 | 'conditions': [ |
mtklein | 8553396 | 2015-08-25 06:30:07 -0700 | [diff] [blame] | 154 | [ 'not skia_android_framework', { 'cflags': [ '-mavx' ] }], |
mtklein | 5141d90 | 2015-08-24 10:32:02 -0700 | [diff] [blame] | 155 | ], |
| 156 | }, |
| 157 | { |
| 158 | 'target_name': 'opts_avx2', |
| 159 | 'product_name': 'skia_opts_avx2', |
| 160 | 'type': 'static_library', |
| 161 | 'standalone_static_library': 1, |
| 162 | 'dependencies': [ 'core.gyp:*' ], |
| 163 | 'include_dirs': [ |
| 164 | '../include/private', |
| 165 | '../src/core', |
| 166 | '../src/utils', |
| 167 | ], |
| 168 | 'sources': [ '<@(avx2_sources)' ], |
mtklein | 8553396 | 2015-08-25 06:30:07 -0700 | [diff] [blame] | 169 | 'msvs_settings': { 'VCCLCompilerTool': { 'EnableEnhancedInstructionSet': '5' } }, |
| 170 | 'xcode_settings': { 'OTHER_CFLAGS': [ '-mavx2' ] }, |
mtklein | 5141d90 | 2015-08-24 10:32:02 -0700 | [diff] [blame] | 171 | 'conditions': [ |
mtklein | 8553396 | 2015-08-25 06:30:07 -0700 | [diff] [blame] | 172 | [ 'not skia_android_framework', { 'cflags': [ '-mavx2' ] }], |
mtklein | 5141d90 | 2015-08-24 10:32:02 -0700 | [diff] [blame] | 173 | ], |
| 174 | }, |
| 175 | { |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 176 | 'target_name': 'opts_neon', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 177 | 'product_name': 'skia_opts_neon', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 178 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 179 | 'standalone_static_library': 1, |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 180 | 'dependencies': [ |
| 181 | 'core.gyp:*', |
senorblanco@chromium.org | 0ded88d | 2014-01-24 15:43:50 +0000 | [diff] [blame] | 182 | 'effects.gyp:*' |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 183 | ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 184 | 'include_dirs': [ |
mtklein | cd1f2da | 2015-07-28 08:55:14 -0700 | [diff] [blame] | 185 | '../include/private', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 186 | '../src/core', |
digit@google.com | fce02ac | 2012-08-01 14:25:07 +0000 | [diff] [blame] | 187 | '../src/opts', |
krajcevski | 630598c | 2014-07-14 12:00:04 -0700 | [diff] [blame] | 188 | '../src/utils', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 189 | ], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 190 | 'sources': [ '<@(neon_sources)' ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 191 | 'cflags!': [ |
| 192 | '-fno-omit-frame-pointer', |
| 193 | '-mfpu=vfp', # remove them all, just in case. |
| 194 | '-mfpu=vfpv3', |
| 195 | '-mfpu=vfpv3-d16', |
| 196 | ], |
commit-bot@chromium.org | e72a408 | 2014-02-28 16:07:39 +0000 | [diff] [blame] | 197 | 'conditions': [ |
| 198 | [ 'not skia_android_framework', { |
| 199 | 'cflags': [ |
| 200 | '-mfpu=neon', |
| 201 | '-fomit-frame-pointer', |
| 202 | ], |
| 203 | }], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 204 | ], |
djsollen@google.com | 4dcc624 | 2013-01-23 18:56:38 +0000 | [diff] [blame] | 205 | 'ldflags': [ |
| 206 | '-march=armv7-a', |
| 207 | '-Wl,--fix-cortex-a8', |
| 208 | ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 209 | }, |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 210 | ], |
| 211 | } |