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 | # (To be honest, I'm not sure why we need to include common.gypi. I thought it was automatic.) |
| 8 | 'variables': { |
Mike Klein | eb94e56 | 2016-10-26 18:37:24 -0400 | [diff] [blame] | 9 | 'includes': [ 'common.gypi' ], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 10 | }, |
mtklein | 0933725 | 2015-01-26 18:15:31 -0800 | [diff] [blame] | 11 | |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 12 | # Generally we shove things into one 'opts' target conditioned on platform. |
| 13 | # If a particular platform needs some files built with different flags, |
| 14 | # those become separate targets: opts_ssse3, opts_sse41, opts_neon. |
| 15 | |
| 16 | 'targets': [ |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 17 | { |
| 18 | 'target_name': 'opts', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 19 | 'product_name': 'skia_opts', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 20 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 21 | 'standalone_static_library': 1, |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 22 | 'dependencies': [ |
| 23 | 'core.gyp:*', |
senorblanco@chromium.org | 0ded88d | 2014-01-24 15:43:50 +0000 | [diff] [blame] | 24 | 'effects.gyp:*' |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 25 | ], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 26 | 'include_dirs': [ |
mtklein | cd1f2da | 2015-07-28 08:55:14 -0700 | [diff] [blame] | 27 | '../include/private', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 28 | '../src/core', |
djsollen@google.com | a44e6c6 | 2012-01-09 14:38:25 +0000 | [diff] [blame] | 29 | '../src/opts', |
krajcevski | 630598c | 2014-07-14 12:00:04 -0700 | [diff] [blame] | 30 | '../src/utils', |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 31 | '../include/utils', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 32 | ], |
| 33 | 'conditions': [ |
scroggo | df1c337 | 2015-02-12 10:48:25 -0800 | [diff] [blame] | 34 | [ '"x86" in skia_arch_type and skia_os != "ios"', { |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 35 | 'cflags': [ '-msse2' ], |
Mike Klein | 78d5a3b | 2016-09-30 10:48:01 -0400 | [diff] [blame] | 36 | 'dependencies': [ 'opts_ssse3', 'opts_sse41', 'opts_sse42', 'opts_avx', 'opts_hsw' ], |
Mike Klein | eb94e56 | 2016-10-26 18:37:24 -0400 | [diff] [blame] | 37 | 'sources': [ '<!@(python read_gni.py ../gn/opts.gni sse2)' ], |
mtklein | c98fe3a | 2015-01-26 18:05:37 -0800 | [diff] [blame] | 38 | }], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 39 | |
| 40 | [ 'skia_arch_type == "mips"', { |
| 41 | 'conditions': [ |
| 42 | [ '(mips_arch_variant == "mips32r2") and (mips_dsp == 1 or mips_dsp == 2)', { |
Mike Klein | eb94e56 | 2016-10-26 18:37:24 -0400 | [diff] [blame] | 43 | 'sources': [ '<!@(python read_gni.py ../gn/opts.gni mips_dsp)' ], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 44 | },{ |
Mike Klein | eb94e56 | 2016-10-26 18:37:24 -0400 | [diff] [blame] | 45 | 'sources': [ '<!@(python read_gni.py ../gn/opts.gni none)' ], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 46 | }], |
| 47 | ] |
| 48 | }], |
| 49 | |
| 50 | [ '(skia_arch_type == "arm" and arm_version < 7) \ |
mtklein | f3f9440 | 2015-04-17 14:02:40 -0700 | [diff] [blame] | 51 | or (skia_os == "ios") \ |
scroggo | df1c337 | 2015-02-12 10:48:25 -0800 | [diff] [blame] | 52 | or (skia_os == "android" \ |
mtklein | f3f9440 | 2015-04-17 14:02:40 -0700 | [diff] [blame] | 53 | and skia_arch_type not in ["x86", "x86_64", "arm", "mips", \ |
| 54 | "arm64"])', { |
Mike Klein | eb94e56 | 2016-10-26 18:37:24 -0400 | [diff] [blame] | 55 | 'sources': [ '<!@(python read_gni.py ../gn/opts.gni none)' ], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 56 | }], |
| 57 | |
djsollen@google.com | f7542ba | 2013-07-31 12:57:27 +0000 | [diff] [blame] | 58 | [ 'skia_arch_type == "arm" and arm_version >= 7', { |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 59 | # The assembly uses the frame pointer register (r7 in Thumb/r11 in |
| 60 | # ARM), the compiler doesn't like that. |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 61 | 'cflags!': [ '-fno-omit-frame-pointer', '-mapcs-frame', '-mapcs' ], |
| 62 | 'cflags': [ '-fomit-frame-pointer' ], |
Mike Klein | eb94e56 | 2016-10-26 18:37:24 -0400 | [diff] [blame] | 63 | 'sources': [ '<!@(python read_gni.py ../gn/opts.gni armv7)' ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 64 | 'conditions': [ |
mtklein | 809ccf3 | 2016-05-05 10:58:39 -0700 | [diff] [blame] | 65 | [ 'arm_neon == 1', { |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 66 | 'dependencies': [ 'opts_neon' ] |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 67 | }], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 68 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 69 | }], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 70 | |
| 71 | [ 'skia_arch_type == "arm64"', { |
Mike Klein | eb94e56 | 2016-10-26 18:37:24 -0400 | [diff] [blame] | 72 | 'sources': [ '<!@(python read_gni.py ../gn/opts.gni arm64)' ], |
mtklein | 9c3887c | 2016-08-19 08:07:51 -0700 | [diff] [blame] | 73 | 'dependencies': [ 'opts_crc32' ] |
djordje.pesut | 632a454 | 2014-06-11 06:56:10 -0700 | [diff] [blame] | 74 | }], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 75 | |
commit-bot@chromium.org | e72a408 | 2014-02-28 16:07:39 +0000 | [diff] [blame] | 76 | [ 'skia_android_framework', { |
| 77 | 'cflags!': [ |
| 78 | '-msse2', |
| 79 | '-mfpu=neon', |
| 80 | '-fomit-frame-pointer', |
commit-bot@chromium.org | e72a408 | 2014-02-28 16:07:39 +0000 | [diff] [blame] | 81 | ] |
| 82 | }], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 83 | ], |
| 84 | }, |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 85 | { |
mtklein | 9c3887c | 2016-08-19 08:07:51 -0700 | [diff] [blame] | 86 | 'target_name': 'opts_crc32', |
| 87 | 'product_name': 'skia_opts_crc32', |
| 88 | 'type': 'static_library', |
| 89 | 'standalone_static_library': 1, |
| 90 | 'dependencies': [ 'core.gyp:*' ], |
| 91 | 'include_dirs': [ |
| 92 | '../include/private', |
| 93 | '../src/core', |
| 94 | '../src/utils', |
| 95 | ], |
Mike Klein | eb94e56 | 2016-10-26 18:37:24 -0400 | [diff] [blame] | 96 | 'sources': [ '<!@(python read_gni.py ../gn/opts.gni crc32)' ], |
mtklein | 9c3887c | 2016-08-19 08:07:51 -0700 | [diff] [blame] | 97 | 'conditions': [ |
| 98 | [ 'not skia_android_framework', { 'cflags': [ '-march=armv8-a+crc' ] }], |
| 99 | ], |
| 100 | }, |
| 101 | { |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 102 | 'target_name': 'opts_ssse3', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 103 | 'product_name': 'skia_opts_ssse3', |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 104 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 105 | 'standalone_static_library': 1, |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 106 | 'dependencies': [ 'core.gyp:*' ], |
mtklein | cd1f2da | 2015-07-28 08:55:14 -0700 | [diff] [blame] | 107 | 'include_dirs': [ |
| 108 | '../include/private', |
| 109 | '../src/core', |
mtklein | b639474 | 2015-08-06 08:17:16 -0700 | [diff] [blame] | 110 | '../src/utils', |
mtklein | cd1f2da | 2015-07-28 08:55:14 -0700 | [diff] [blame] | 111 | ], |
Mike Klein | eb94e56 | 2016-10-26 18:37:24 -0400 | [diff] [blame] | 112 | 'sources': [ '<!@(python read_gni.py ../gn/opts.gni ssse3)' ], |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 113 | 'conditions': [ |
mtklein | 8553396 | 2015-08-25 06:30:07 -0700 | [diff] [blame] | 114 | [ 'skia_os == "win"', { 'defines' : [ 'SK_CPU_SSE_LEVEL=31' ] }], |
| 115 | [ 'not skia_android_framework', { 'cflags': [ '-mssse3' ] }], |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 116 | ], |
| 117 | }, |
henrik.smiding | 3bb195e | 2014-06-27 08:03:17 -0700 | [diff] [blame] | 118 | { |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 119 | 'target_name': 'opts_sse41', |
| 120 | 'product_name': 'skia_opts_sse41', |
henrik.smiding | 3bb195e | 2014-06-27 08:03:17 -0700 | [diff] [blame] | 121 | 'type': 'static_library', |
| 122 | 'standalone_static_library': 1, |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 123 | 'dependencies': [ 'core.gyp:*' ], |
mtklein | cd1f2da | 2015-07-28 08:55:14 -0700 | [diff] [blame] | 124 | 'include_dirs': [ |
| 125 | '../include/private', |
| 126 | '../src/core', |
mtklein | b639474 | 2015-08-06 08:17:16 -0700 | [diff] [blame] | 127 | '../src/utils', |
mtklein | cd1f2da | 2015-07-28 08:55:14 -0700 | [diff] [blame] | 128 | ], |
Mike Klein | eb94e56 | 2016-10-26 18:37:24 -0400 | [diff] [blame] | 129 | 'sources': [ '<!@(python read_gni.py ../gn/opts.gni sse41)' ], |
mtklein | 8553396 | 2015-08-25 06:30:07 -0700 | [diff] [blame] | 130 | 'xcode_settings': { 'GCC_ENABLE_SSE41_EXTENSIONS': 'YES' }, |
henrik.smiding | 3bb195e | 2014-06-27 08:03:17 -0700 | [diff] [blame] | 131 | 'conditions': [ |
mtklein | 8553396 | 2015-08-25 06:30:07 -0700 | [diff] [blame] | 132 | [ 'skia_os == "win"', { 'defines' : [ 'SK_CPU_SSE_LEVEL=41' ] }], |
| 133 | [ 'not skia_android_framework', { 'cflags': [ '-msse4.1' ] }], |
henrik.smiding | 3bb195e | 2014-06-27 08:03:17 -0700 | [diff] [blame] | 134 | ], |
| 135 | }, |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 136 | { |
mtklein | 5141d90 | 2015-08-24 10:32:02 -0700 | [diff] [blame] | 137 | 'target_name': 'opts_sse42', |
| 138 | 'product_name': 'skia_opts_sse42', |
| 139 | 'type': 'static_library', |
| 140 | 'standalone_static_library': 1, |
| 141 | 'dependencies': [ 'core.gyp:*' ], |
| 142 | 'include_dirs': [ |
| 143 | '../include/private', |
| 144 | '../src/core', |
| 145 | '../src/utils', |
| 146 | ], |
Mike Klein | eb94e56 | 2016-10-26 18:37:24 -0400 | [diff] [blame] | 147 | 'sources': [ '<!@(python read_gni.py ../gn/opts.gni sse42)' ], |
mtklein | 8553396 | 2015-08-25 06:30:07 -0700 | [diff] [blame] | 148 | 'xcode_settings': { 'GCC_ENABLE_SSE42_EXTENSIONS': 'YES' }, |
mtklein | 5141d90 | 2015-08-24 10:32:02 -0700 | [diff] [blame] | 149 | 'conditions': [ |
mtklein | 8553396 | 2015-08-25 06:30:07 -0700 | [diff] [blame] | 150 | [ 'skia_os == "win"', { 'defines' : [ 'SK_CPU_SSE_LEVEL=42' ] }], |
| 151 | [ 'not skia_android_framework', { 'cflags': [ '-msse4.2' ] }], |
mtklein | 5141d90 | 2015-08-24 10:32:02 -0700 | [diff] [blame] | 152 | ], |
| 153 | }, |
| 154 | { |
| 155 | 'target_name': 'opts_avx', |
| 156 | 'product_name': 'skia_opts_avx', |
| 157 | 'type': 'static_library', |
| 158 | 'standalone_static_library': 1, |
| 159 | 'dependencies': [ 'core.gyp:*' ], |
| 160 | 'include_dirs': [ |
| 161 | '../include/private', |
| 162 | '../src/core', |
| 163 | '../src/utils', |
| 164 | ], |
Mike Klein | eb94e56 | 2016-10-26 18:37:24 -0400 | [diff] [blame] | 165 | 'sources': [ '<!@(python read_gni.py ../gn/opts.gni avx)' ], |
mtklein | 8553396 | 2015-08-25 06:30:07 -0700 | [diff] [blame] | 166 | 'msvs_settings': { 'VCCLCompilerTool': { 'EnableEnhancedInstructionSet': '3' } }, |
mtklein | 2047334 | 2016-01-25 09:26:54 -0800 | [diff] [blame] | 167 | 'xcode_settings': { 'OTHER_CPLUSPLUSFLAGS': [ '-mavx' ] }, |
mtklein | 5141d90 | 2015-08-24 10:32:02 -0700 | [diff] [blame] | 168 | 'conditions': [ |
mtklein | 8553396 | 2015-08-25 06:30:07 -0700 | [diff] [blame] | 169 | [ 'not skia_android_framework', { 'cflags': [ '-mavx' ] }], |
mtklein | 5141d90 | 2015-08-24 10:32:02 -0700 | [diff] [blame] | 170 | ], |
| 171 | }, |
| 172 | { |
Mike Klein | 78d5a3b | 2016-09-30 10:48:01 -0400 | [diff] [blame] | 173 | 'target_name': 'opts_hsw', |
| 174 | 'product_name': 'skia_opts_hsw', |
mtklein | 5141d90 | 2015-08-24 10:32:02 -0700 | [diff] [blame] | 175 | 'type': 'static_library', |
| 176 | 'standalone_static_library': 1, |
| 177 | 'dependencies': [ 'core.gyp:*' ], |
| 178 | 'include_dirs': [ |
| 179 | '../include/private', |
| 180 | '../src/core', |
| 181 | '../src/utils', |
| 182 | ], |
Mike Klein | eb94e56 | 2016-10-26 18:37:24 -0400 | [diff] [blame] | 183 | 'sources': [ '<!@(python read_gni.py ../gn/opts.gni hsw)' ], |
mtklein | 8553396 | 2015-08-25 06:30:07 -0700 | [diff] [blame] | 184 | 'msvs_settings': { 'VCCLCompilerTool': { 'EnableEnhancedInstructionSet': '5' } }, |
Mike Klein | 78d5a3b | 2016-09-30 10:48:01 -0400 | [diff] [blame] | 185 | 'xcode_settings': { |
| 186 | 'OTHER_CPLUSPLUSFLAGS': [ '-mavx2', '-mbmi', '-mbmi2', '-mf16c', '-mfma' ] |
| 187 | }, |
mtklein | 5141d90 | 2015-08-24 10:32:02 -0700 | [diff] [blame] | 188 | 'conditions': [ |
Mike Klein | 78d5a3b | 2016-09-30 10:48:01 -0400 | [diff] [blame] | 189 | [ 'not skia_android_framework', { |
| 190 | 'cflags': [ '-mavx2', '-mbmi', '-mbmi2', '-mf16c', '-mfma' ] |
| 191 | }], |
mtklein | 5141d90 | 2015-08-24 10:32:02 -0700 | [diff] [blame] | 192 | ], |
| 193 | }, |
| 194 | { |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 195 | 'target_name': 'opts_neon', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 196 | 'product_name': 'skia_opts_neon', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 197 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 198 | 'standalone_static_library': 1, |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 199 | 'dependencies': [ |
| 200 | 'core.gyp:*', |
senorblanco@chromium.org | 0ded88d | 2014-01-24 15:43:50 +0000 | [diff] [blame] | 201 | 'effects.gyp:*' |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 202 | ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 203 | 'include_dirs': [ |
mtklein | cd1f2da | 2015-07-28 08:55:14 -0700 | [diff] [blame] | 204 | '../include/private', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 205 | '../src/core', |
digit@google.com | fce02ac | 2012-08-01 14:25:07 +0000 | [diff] [blame] | 206 | '../src/opts', |
krajcevski | 630598c | 2014-07-14 12:00:04 -0700 | [diff] [blame] | 207 | '../src/utils', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 208 | ], |
Mike Klein | eb94e56 | 2016-10-26 18:37:24 -0400 | [diff] [blame] | 209 | 'sources': [ '<!@(python read_gni.py ../gn/opts.gni neon)' ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 210 | 'cflags!': [ |
| 211 | '-fno-omit-frame-pointer', |
| 212 | '-mfpu=vfp', # remove them all, just in case. |
| 213 | '-mfpu=vfpv3', |
| 214 | '-mfpu=vfpv3-d16', |
| 215 | ], |
commit-bot@chromium.org | e72a408 | 2014-02-28 16:07:39 +0000 | [diff] [blame] | 216 | 'conditions': [ |
| 217 | [ 'not skia_android_framework', { |
| 218 | 'cflags': [ |
| 219 | '-mfpu=neon', |
| 220 | '-fomit-frame-pointer', |
| 221 | ], |
| 222 | }], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 223 | ], |
djsollen@google.com | 4dcc624 | 2013-01-23 18:56:38 +0000 | [diff] [blame] | 224 | 'ldflags': [ |
| 225 | '-march=armv7-a', |
| 226 | '-Wl,--fix-cortex-a8', |
| 227 | ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 228 | }, |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 229 | ], |
| 230 | } |