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': [ |
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' ], |
mtklein | d160192 | 2015-02-10 18:18:18 -0800 | [diff] [blame] | 36 | 'dependencies': [ 'opts_ssse3', 'opts_sse41' ], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 37 | 'sources': [ '<@(sse2_sources)' ], |
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)', { |
| 43 | 'sources': [ '<@(mips_dsp_sources)' ], |
| 44 | },{ |
| 45 | 'sources': [ '<@(none_sources)' ], |
| 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"])', { |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 55 | 'sources': [ '<@(none_sources)' ], |
| 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' ], |
| 63 | 'variables': { 'arm_neon_optional%': '<(arm_neon_optional>' }, |
| 64 | 'sources': [ '<@(armv7_sources)' ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 65 | 'conditions': [ |
| 66 | [ 'arm_neon == 1 or arm_neon_optional == 1', { |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 67 | 'dependencies': [ 'opts_neon' ] |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 68 | }], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 69 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 70 | }], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 71 | |
| 72 | [ 'skia_arch_type == "arm64"', { |
| 73 | 'sources': [ '<@(arm64_sources)' ], |
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 | { |
| 86 | 'target_name': 'opts_ssse3', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 87 | 'product_name': 'skia_opts_ssse3', |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 88 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 89 | 'standalone_static_library': 1, |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 90 | 'dependencies': [ 'core.gyp:*' ], |
| 91 | 'include_dirs': [ '../src/core' ], |
| 92 | 'sources': [ '<@(ssse3_sources)' ], |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 93 | 'conditions': [ |
djsollen | bc89329 | 2014-07-24 13:53:56 -0700 | [diff] [blame] | 94 | [ 'skia_os == "win"', { |
| 95 | 'defines' : [ 'SK_CPU_SSE_LEVEL=31' ], |
| 96 | }], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 97 | [ 'not skia_android_framework', { |
| 98 | 'cflags': [ '-mssse3' ], |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 99 | }], |
tomhudson@google.com | 95ad155 | 2012-02-14 18:28:54 +0000 | [diff] [blame] | 100 | ], |
| 101 | }, |
henrik.smiding | 3bb195e | 2014-06-27 08:03:17 -0700 | [diff] [blame] | 102 | { |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 103 | 'target_name': 'opts_sse41', |
| 104 | 'product_name': 'skia_opts_sse41', |
henrik.smiding | 3bb195e | 2014-06-27 08:03:17 -0700 | [diff] [blame] | 105 | 'type': 'static_library', |
| 106 | 'standalone_static_library': 1, |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 107 | 'dependencies': [ 'core.gyp:*' ], |
| 108 | 'sources': [ '<@(sse41_sources)' ], |
henrik.smiding | 3bb195e | 2014-06-27 08:03:17 -0700 | [diff] [blame] | 109 | 'conditions': [ |
djsollen | bc89329 | 2014-07-24 13:53:56 -0700 | [diff] [blame] | 110 | [ 'skia_os == "win"', { |
| 111 | 'defines' : [ 'SK_CPU_SSE_LEVEL=41' ], |
| 112 | }], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 113 | [ 'not skia_android_framework', { |
| 114 | 'cflags': [ '-msse4.1' ], |
henrik.smiding | 3bb195e | 2014-06-27 08:03:17 -0700 | [diff] [blame] | 115 | }], |
henrik.smiding | 5f7f9d0 | 2014-07-07 08:05:40 -0700 | [diff] [blame] | 116 | [ 'skia_os == "mac"', { |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 117 | 'xcode_settings': { 'GCC_ENABLE_SSE41_EXTENSIONS': 'YES' }, |
henrik.smiding | 5f7f9d0 | 2014-07-07 08:05:40 -0700 | [diff] [blame] | 118 | }], |
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 | { |
| 122 | 'target_name': 'opts_neon', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 123 | 'product_name': 'skia_opts_neon', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 124 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 125 | 'standalone_static_library': 1, |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 126 | 'dependencies': [ |
| 127 | 'core.gyp:*', |
senorblanco@chromium.org | 0ded88d | 2014-01-24 15:43:50 +0000 | [diff] [blame] | 128 | 'effects.gyp:*' |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 129 | ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 130 | 'include_dirs': [ |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 131 | '../src/core', |
digit@google.com | fce02ac | 2012-08-01 14:25:07 +0000 | [diff] [blame] | 132 | '../src/opts', |
krajcevski | 630598c | 2014-07-14 12:00:04 -0700 | [diff] [blame] | 133 | '../src/utils', |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 134 | ], |
mtklein | f7069d5 | 2015-01-26 18:55:58 -0800 | [diff] [blame] | 135 | 'sources': [ '<@(neon_sources)' ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 136 | 'cflags!': [ |
| 137 | '-fno-omit-frame-pointer', |
| 138 | '-mfpu=vfp', # remove them all, just in case. |
| 139 | '-mfpu=vfpv3', |
| 140 | '-mfpu=vfpv3-d16', |
| 141 | ], |
commit-bot@chromium.org | e72a408 | 2014-02-28 16:07:39 +0000 | [diff] [blame] | 142 | 'conditions': [ |
| 143 | [ 'not skia_android_framework', { |
| 144 | 'cflags': [ |
| 145 | '-mfpu=neon', |
| 146 | '-fomit-frame-pointer', |
| 147 | ], |
| 148 | }], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 149 | ], |
djsollen@google.com | 4dcc624 | 2013-01-23 18:56:38 +0000 | [diff] [blame] | 150 | 'ldflags': [ |
| 151 | '-march=armv7-a', |
| 152 | '-Wl,--fix-cortex-a8', |
| 153 | ], |
digit@google.com | eec9dbc | 2012-05-30 13:54:41 +0000 | [diff] [blame] | 154 | }, |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 155 | ], |
| 156 | } |