blob: 7c62ba8c9b383f5ce8808b3ea4238bbb7e81f560 [file] [log] [blame]
epoger@google.comae85aea2011-05-31 13:50:51 +00001{
mtkleinc98fe3a2015-01-26 18:05:37 -08002 # Source lists live in opts.gypi. This makes it easier to maintain our Chrome GYP/GN setup.
3 # (To be honest, I'm not sure why we need to include common.gypi. I thought it was automatic.)
4 'variables': {
5 'includes': [ 'common.gypi', 'opts.gypi' ],
6 },
epoger@google.comae85aea2011-05-31 13:50:51 +00007
mtkleinc98fe3a2015-01-26 18:05:37 -08008 # Generally we shove things into one 'opts' target conditioned on platform.
9 # If a particular platform needs some files built with different flags,
10 # those become separate targets: opts_ssse3, opts_sse41, opts_neon.
11
12 'targets': [
epoger@google.comae85aea2011-05-31 13:50:51 +000013 {
14 'target_name': 'opts',
borenet@google.comefb1d772012-10-10 19:45:51 +000015 'product_name': 'skia_opts',
epoger@google.comae85aea2011-05-31 13:50:51 +000016 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +000017 'standalone_static_library': 1,
bungeman@google.comb8f36552013-07-22 14:39:45 +000018 'dependencies': [
19 'core.gyp:*',
senorblanco@chromium.org0ded88d2014-01-24 15:43:50 +000020 'effects.gyp:*'
bungeman@google.comb8f36552013-07-22 14:39:45 +000021 ],
epoger@google.comae85aea2011-05-31 13:50:51 +000022 'include_dirs': [
epoger@google.comae85aea2011-05-31 13:50:51 +000023 '../src/core',
djsollen@google.coma44e6c62012-01-09 14:38:25 +000024 '../src/opts',
krajcevski630598c2014-07-14 12:00:04 -070025 '../src/utils',
mtkleinc98fe3a2015-01-26 18:05:37 -080026 '../include/utils',
epoger@google.comae85aea2011-05-31 13:50:51 +000027 ],
28 'conditions': [
caryclark@google.com867cbd82012-09-20 15:45:41 +000029 [ 'skia_arch_type == "x86" and skia_os != "ios"', {
mtkleinc98fe3a2015-01-26 18:05:37 -080030 'cflags': [ '-msse2' ],
31 'dependencies': [ 'opts_ssse3', 'opts_sse41' ],
32 'sources': [ '<@(sse2_sources)' ],
djsollen@google.com58629292011-11-03 13:08:29 +000033 }],
mtkleinc98fe3a2015-01-26 18:05:37 -080034
35 [ 'skia_arch_type == "mips"', {
36 'conditions': [
37 [ '(mips_arch_variant == "mips32r2") and (mips_dsp == 1 or mips_dsp == 2)', {
38 'sources': [ '<@(mips_dsp_sources)' ],
39 },{
40 'sources': [ '<@(none_sources)' ],
41 }],
42 ]
43 }],
44
45 [ '(skia_arch_type == "arm" and arm_version < 7) \
46 or (skia_os == "ios") \
47 or (skia_os == "android" and skia_arch_type not in ["x86", "arm", "mips", "arm64"])', {
48 'sources': [ '<@(none_sources)' ],
49 }],
50
djsollen@google.comf7542ba2013-07-31 12:57:27 +000051 [ 'skia_arch_type == "arm" and arm_version >= 7', {
djsollen@google.com58629292011-11-03 13:08:29 +000052 # The assembly uses the frame pointer register (r7 in Thumb/r11 in
53 # ARM), the compiler doesn't like that.
mtkleinc98fe3a2015-01-26 18:05:37 -080054 'cflags!': [ '-fno-omit-frame-pointer', '-mapcs-frame', '-mapcs' ],
55 'cflags': [ '-fomit-frame-pointer' ],
56 'variables': { 'arm_neon_optional%': '<(arm_neon_optional>' },
57 'sources': [ '<@(armv7_sources)' ],
digit@google.comeec9dbc2012-05-30 13:54:41 +000058 'conditions': [
59 [ 'arm_neon == 1 or arm_neon_optional == 1', {
mtkleinc98fe3a2015-01-26 18:05:37 -080060 'dependencies': [ 'opts_neon' ]
caryclark@google.com867cbd82012-09-20 15:45:41 +000061 }],
62 [ 'skia_os == "ios"', {
63 'sources!': [
caryclark@google.com594dd3c2012-09-24 19:33:57 +000064 # these fail to compile under xcode for ios
caryclark@google.com867cbd82012-09-20 15:45:41 +000065 '../src/opts/memset.arm.S',
caryclark@google.com594dd3c2012-09-24 19:33:57 +000066 '../src/opts/SkBitmapProcState_opts_arm.cpp',
67 '../src/opts/SkBlitRow_opts_arm.cpp',
caryclark@google.com867cbd82012-09-20 15:45:41 +000068 ],
69 }],
digit@google.comeec9dbc2012-05-30 13:54:41 +000070 ],
djsollen@google.com58629292011-11-03 13:08:29 +000071 }],
mtkleinc98fe3a2015-01-26 18:05:37 -080072
73 [ 'skia_arch_type == "arm64"', {
74 'sources': [ '<@(armv64_sources)' ],
djordje.pesut632a4542014-06-11 06:56:10 -070075 }],
mtkleinc98fe3a2015-01-26 18:05:37 -080076
commit-bot@chromium.orge72a4082014-02-28 16:07:39 +000077 [ 'skia_android_framework', {
78 'cflags!': [
79 '-msse2',
80 '-mfpu=neon',
81 '-fomit-frame-pointer',
commit-bot@chromium.orge72a4082014-02-28 16:07:39 +000082 ]
83 }],
epoger@google.comae85aea2011-05-31 13:50:51 +000084 ],
85 },
tomhudson@google.com95ad1552012-02-14 18:28:54 +000086 {
87 'target_name': 'opts_ssse3',
borenet@google.comefb1d772012-10-10 19:45:51 +000088 'product_name': 'skia_opts_ssse3',
tomhudson@google.com95ad1552012-02-14 18:28:54 +000089 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +000090 'standalone_static_library': 1,
mtkleinc98fe3a2015-01-26 18:05:37 -080091 'dependencies': [ 'core.gyp:*' ],
92 'include_dirs': [ '../src/core' ],
93 'sources': [ '<@(ssse3_sources)' ],
tomhudson@google.com95ad1552012-02-14 18:28:54 +000094 'conditions': [
djsollenbc893292014-07-24 13:53:56 -070095 [ 'skia_os == "win"', {
96 'defines' : [ 'SK_CPU_SSE_LEVEL=31' ],
97 }],
mtkleinc98fe3a2015-01-26 18:05:37 -080098 [ 'not skia_android_framework', {
99 'cflags': [ '-mssse3' ],
tomhudson@google.com95ad1552012-02-14 18:28:54 +0000100 }],
tomhudson@google.com95ad1552012-02-14 18:28:54 +0000101 ],
102 },
henrik.smiding3bb195e2014-06-27 08:03:17 -0700103 {
mtkleinc98fe3a2015-01-26 18:05:37 -0800104 'target_name': 'opts_sse41',
105 'product_name': 'skia_opts_sse41',
henrik.smiding3bb195e2014-06-27 08:03:17 -0700106 'type': 'static_library',
107 'standalone_static_library': 1,
mtkleinc98fe3a2015-01-26 18:05:37 -0800108 'dependencies': [ 'core.gyp:*' ],
109 'sources': [ '<@(sse41_sources)' ],
henrik.smiding3bb195e2014-06-27 08:03:17 -0700110 'conditions': [
djsollenbc893292014-07-24 13:53:56 -0700111 [ 'skia_os == "win"', {
112 'defines' : [ 'SK_CPU_SSE_LEVEL=41' ],
113 }],
mtkleinc98fe3a2015-01-26 18:05:37 -0800114 [ 'not skia_android_framework', {
115 'cflags': [ '-msse4.1' ],
henrik.smiding3bb195e2014-06-27 08:03:17 -0700116 }],
henrik.smiding5f7f9d02014-07-07 08:05:40 -0700117 [ 'skia_os == "mac"', {
mtkleinc98fe3a2015-01-26 18:05:37 -0800118 'xcode_settings': { 'GCC_ENABLE_SSE41_EXTENSIONS': 'YES' },
henrik.smiding5f7f9d02014-07-07 08:05:40 -0700119 }],
henrik.smiding3bb195e2014-06-27 08:03:17 -0700120 ],
121 },
digit@google.comeec9dbc2012-05-30 13:54:41 +0000122 {
123 'target_name': 'opts_neon',
borenet@google.comefb1d772012-10-10 19:45:51 +0000124 'product_name': 'skia_opts_neon',
digit@google.comeec9dbc2012-05-30 13:54:41 +0000125 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +0000126 'standalone_static_library': 1,
bungeman@google.comb8f36552013-07-22 14:39:45 +0000127 'dependencies': [
128 'core.gyp:*',
senorblanco@chromium.org0ded88d2014-01-24 15:43:50 +0000129 'effects.gyp:*'
bungeman@google.comb8f36552013-07-22 14:39:45 +0000130 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000131 'include_dirs': [
digit@google.comeec9dbc2012-05-30 13:54:41 +0000132 '../src/core',
digit@google.comfce02ac2012-08-01 14:25:07 +0000133 '../src/opts',
krajcevski630598c2014-07-14 12:00:04 -0700134 '../src/utils',
digit@google.comeec9dbc2012-05-30 13:54:41 +0000135 ],
mtkleinc98fe3a2015-01-26 18:05:37 -0800136 'sources': [ '<@(neon_sources)' ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000137 'cflags!': [
138 '-fno-omit-frame-pointer',
139 '-mfpu=vfp', # remove them all, just in case.
140 '-mfpu=vfpv3',
141 '-mfpu=vfpv3-d16',
142 ],
commit-bot@chromium.orge72a4082014-02-28 16:07:39 +0000143 'conditions': [
144 [ 'not skia_android_framework', {
145 'cflags': [
146 '-mfpu=neon',
147 '-fomit-frame-pointer',
148 ],
149 }],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000150 ],
djsollen@google.com4dcc6242013-01-23 18:56:38 +0000151 'ldflags': [
152 '-march=armv7-a',
153 '-Wl,--fix-cortex-a8',
154 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000155 },
epoger@google.comae85aea2011-05-31 13:50:51 +0000156 ],
157}