blob: 6ff900863c801019dc569ff46130dc3c02a37760 [file] [log] [blame]
scroggodf1c3372015-02-12 10:48:25 -08001# Gyp file for building opts target.
epoger@google.comae85aea2011-05-31 13:50:51 +00002{
mtkleinf7069d52015-01-26 18:55:58 -08003 # Source lists live in opts.gypi. This makes it easier to maintain our Chrome GYP/GN setup.
4 # (To be honest, I'm not sure why we need to include common.gypi. I thought it was automatic.)
5 'variables': {
6 'includes': [ 'common.gypi', 'opts.gypi' ],
7 },
mtklein09337252015-01-26 18:15:31 -08008
mtkleinf7069d52015-01-26 18:55:58 -08009 # Generally we shove things into one 'opts' target conditioned on platform.
10 # If a particular platform needs some files built with different flags,
11 # those become separate targets: opts_ssse3, opts_sse41, opts_neon.
12
13 'targets': [
epoger@google.comae85aea2011-05-31 13:50:51 +000014 {
15 'target_name': 'opts',
borenet@google.comefb1d772012-10-10 19:45:51 +000016 'product_name': 'skia_opts',
epoger@google.comae85aea2011-05-31 13:50:51 +000017 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +000018 'standalone_static_library': 1,
bungeman@google.comb8f36552013-07-22 14:39:45 +000019 'dependencies': [
20 'core.gyp:*',
senorblanco@chromium.org0ded88d2014-01-24 15:43:50 +000021 'effects.gyp:*'
bungeman@google.comb8f36552013-07-22 14:39:45 +000022 ],
epoger@google.comae85aea2011-05-31 13:50:51 +000023 'include_dirs': [
epoger@google.comae85aea2011-05-31 13:50:51 +000024 '../src/core',
djsollen@google.coma44e6c62012-01-09 14:38:25 +000025 '../src/opts',
krajcevski630598c2014-07-14 12:00:04 -070026 '../src/utils',
mtkleinf7069d52015-01-26 18:55:58 -080027 '../include/utils',
epoger@google.comae85aea2011-05-31 13:50:51 +000028 ],
29 'conditions': [
scroggodf1c3372015-02-12 10:48:25 -080030 [ '"x86" in skia_arch_type and skia_os != "ios"', {
mtkleinf7069d52015-01-26 18:55:58 -080031 'cflags': [ '-msse2' ],
mtkleind1601922015-02-10 18:18:18 -080032 'dependencies': [ 'opts_ssse3', 'opts_sse41' ],
mtkleinf7069d52015-01-26 18:55:58 -080033 'sources': [ '<@(sse2_sources)' ],
mtkleinc98fe3a2015-01-26 18:05:37 -080034 }],
mtkleinf7069d52015-01-26 18:55:58 -080035
36 [ 'skia_arch_type == "mips"', {
37 'conditions': [
38 [ '(mips_arch_variant == "mips32r2") and (mips_dsp == 1 or mips_dsp == 2)', {
39 'sources': [ '<@(mips_dsp_sources)' ],
40 },{
41 'sources': [ '<@(none_sources)' ],
42 }],
43 ]
44 }],
45
46 [ '(skia_arch_type == "arm" and arm_version < 7) \
47 or (skia_os == "ios") \
scroggodf1c3372015-02-12 10:48:25 -080048 or (skia_os == "android" \
49 and skia_arch_type not in ["x86", "x86_64", "arm", "mips", \
50 "arm64"])', {
mtkleinf7069d52015-01-26 18:55:58 -080051 'sources': [ '<@(none_sources)' ],
52 }],
53
djsollen@google.comf7542ba2013-07-31 12:57:27 +000054 [ 'skia_arch_type == "arm" and arm_version >= 7', {
djsollen@google.com58629292011-11-03 13:08:29 +000055 # The assembly uses the frame pointer register (r7 in Thumb/r11 in
56 # ARM), the compiler doesn't like that.
mtkleinf7069d52015-01-26 18:55:58 -080057 'cflags!': [ '-fno-omit-frame-pointer', '-mapcs-frame', '-mapcs' ],
58 'cflags': [ '-fomit-frame-pointer' ],
59 'variables': { 'arm_neon_optional%': '<(arm_neon_optional>' },
60 'sources': [ '<@(armv7_sources)' ],
digit@google.comeec9dbc2012-05-30 13:54:41 +000061 'conditions': [
62 [ 'arm_neon == 1 or arm_neon_optional == 1', {
mtkleinf7069d52015-01-26 18:55:58 -080063 'dependencies': [ 'opts_neon' ]
caryclark@google.com867cbd82012-09-20 15:45:41 +000064 }],
65 [ 'skia_os == "ios"', {
66 'sources!': [
caryclark@google.com594dd3c2012-09-24 19:33:57 +000067 # these fail to compile under xcode for ios
caryclark@google.com867cbd82012-09-20 15:45:41 +000068 '../src/opts/memset.arm.S',
caryclark@google.com594dd3c2012-09-24 19:33:57 +000069 '../src/opts/SkBitmapProcState_opts_arm.cpp',
70 '../src/opts/SkBlitRow_opts_arm.cpp',
caryclark@google.com867cbd82012-09-20 15:45:41 +000071 ],
72 }],
digit@google.comeec9dbc2012-05-30 13:54:41 +000073 ],
djsollen@google.com58629292011-11-03 13:08:29 +000074 }],
mtkleinf7069d52015-01-26 18:55:58 -080075
76 [ 'skia_arch_type == "arm64"', {
77 'sources': [ '<@(arm64_sources)' ],
djordje.pesut632a4542014-06-11 06:56:10 -070078 }],
mtkleinf7069d52015-01-26 18:55:58 -080079
commit-bot@chromium.orge72a4082014-02-28 16:07:39 +000080 [ 'skia_android_framework', {
81 'cflags!': [
82 '-msse2',
83 '-mfpu=neon',
84 '-fomit-frame-pointer',
commit-bot@chromium.orge72a4082014-02-28 16:07:39 +000085 ]
86 }],
epoger@google.comae85aea2011-05-31 13:50:51 +000087 ],
88 },
tomhudson@google.com95ad1552012-02-14 18:28:54 +000089 {
90 'target_name': 'opts_ssse3',
borenet@google.comefb1d772012-10-10 19:45:51 +000091 'product_name': 'skia_opts_ssse3',
tomhudson@google.com95ad1552012-02-14 18:28:54 +000092 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +000093 'standalone_static_library': 1,
mtkleinf7069d52015-01-26 18:55:58 -080094 'dependencies': [ 'core.gyp:*' ],
95 'include_dirs': [ '../src/core' ],
96 'sources': [ '<@(ssse3_sources)' ],
tomhudson@google.com95ad1552012-02-14 18:28:54 +000097 'conditions': [
djsollenbc893292014-07-24 13:53:56 -070098 [ 'skia_os == "win"', {
99 'defines' : [ 'SK_CPU_SSE_LEVEL=31' ],
100 }],
mtkleinf7069d52015-01-26 18:55:58 -0800101 [ 'not skia_android_framework', {
102 'cflags': [ '-mssse3' ],
tomhudson@google.com95ad1552012-02-14 18:28:54 +0000103 }],
tomhudson@google.com95ad1552012-02-14 18:28:54 +0000104 ],
105 },
henrik.smiding3bb195e2014-06-27 08:03:17 -0700106 {
mtkleinf7069d52015-01-26 18:55:58 -0800107 'target_name': 'opts_sse41',
108 'product_name': 'skia_opts_sse41',
henrik.smiding3bb195e2014-06-27 08:03:17 -0700109 'type': 'static_library',
110 'standalone_static_library': 1,
mtkleinf7069d52015-01-26 18:55:58 -0800111 'dependencies': [ 'core.gyp:*' ],
112 'sources': [ '<@(sse41_sources)' ],
henrik.smiding3bb195e2014-06-27 08:03:17 -0700113 'conditions': [
djsollenbc893292014-07-24 13:53:56 -0700114 [ 'skia_os == "win"', {
115 'defines' : [ 'SK_CPU_SSE_LEVEL=41' ],
116 }],
mtkleinf7069d52015-01-26 18:55:58 -0800117 [ 'not skia_android_framework', {
118 'cflags': [ '-msse4.1' ],
henrik.smiding3bb195e2014-06-27 08:03:17 -0700119 }],
henrik.smiding5f7f9d02014-07-07 08:05:40 -0700120 [ 'skia_os == "mac"', {
mtkleinf7069d52015-01-26 18:55:58 -0800121 'xcode_settings': { 'GCC_ENABLE_SSE41_EXTENSIONS': 'YES' },
henrik.smiding5f7f9d02014-07-07 08:05:40 -0700122 }],
henrik.smiding3bb195e2014-06-27 08:03:17 -0700123 ],
124 },
digit@google.comeec9dbc2012-05-30 13:54:41 +0000125 {
126 'target_name': 'opts_neon',
borenet@google.comefb1d772012-10-10 19:45:51 +0000127 'product_name': 'skia_opts_neon',
digit@google.comeec9dbc2012-05-30 13:54:41 +0000128 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +0000129 'standalone_static_library': 1,
bungeman@google.comb8f36552013-07-22 14:39:45 +0000130 'dependencies': [
131 'core.gyp:*',
senorblanco@chromium.org0ded88d2014-01-24 15:43:50 +0000132 'effects.gyp:*'
bungeman@google.comb8f36552013-07-22 14:39:45 +0000133 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000134 'include_dirs': [
digit@google.comeec9dbc2012-05-30 13:54:41 +0000135 '../src/core',
digit@google.comfce02ac2012-08-01 14:25:07 +0000136 '../src/opts',
krajcevski630598c2014-07-14 12:00:04 -0700137 '../src/utils',
digit@google.comeec9dbc2012-05-30 13:54:41 +0000138 ],
mtkleinf7069d52015-01-26 18:55:58 -0800139 'sources': [ '<@(neon_sources)' ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000140 'cflags!': [
141 '-fno-omit-frame-pointer',
142 '-mfpu=vfp', # remove them all, just in case.
143 '-mfpu=vfpv3',
144 '-mfpu=vfpv3-d16',
145 ],
commit-bot@chromium.orge72a4082014-02-28 16:07:39 +0000146 'conditions': [
147 [ 'not skia_android_framework', {
148 'cflags': [
149 '-mfpu=neon',
150 '-fomit-frame-pointer',
151 ],
152 }],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000153 ],
djsollen@google.com4dcc6242013-01-23 18:56:38 +0000154 'ldflags': [
155 '-march=armv7-a',
156 '-Wl,--fix-cortex-a8',
157 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000158 },
epoger@google.comae85aea2011-05-31 13:50:51 +0000159 ],
160}