blob: a60505e556145f5540f6c6a587f5f7b748cb4c61 [file] [log] [blame]
scroggo3e562272015-03-25 10:22:41 -07001# 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.
scroggodf1c3372015-02-12 10:48:25 -08005# Gyp file for building opts target.
epoger@google.comae85aea2011-05-31 13:50:51 +00006{
mtkleinf7069d52015-01-26 18:55:58 -08007 # 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 },
mtklein09337252015-01-26 18:15:31 -080012
mtkleinf7069d52015-01-26 18:55:58 -080013 # 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.comae85aea2011-05-31 13:50:51 +000018 {
19 'target_name': 'opts',
borenet@google.comefb1d772012-10-10 19:45:51 +000020 'product_name': 'skia_opts',
epoger@google.comae85aea2011-05-31 13:50:51 +000021 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +000022 'standalone_static_library': 1,
bungeman@google.comb8f36552013-07-22 14:39:45 +000023 'dependencies': [
24 'core.gyp:*',
senorblanco@chromium.org0ded88d2014-01-24 15:43:50 +000025 'effects.gyp:*'
bungeman@google.comb8f36552013-07-22 14:39:45 +000026 ],
epoger@google.comae85aea2011-05-31 13:50:51 +000027 'include_dirs': [
epoger@google.comae85aea2011-05-31 13:50:51 +000028 '../src/core',
djsollen@google.coma44e6c62012-01-09 14:38:25 +000029 '../src/opts',
krajcevski630598c2014-07-14 12:00:04 -070030 '../src/utils',
mtkleinf7069d52015-01-26 18:55:58 -080031 '../include/utils',
epoger@google.comae85aea2011-05-31 13:50:51 +000032 ],
33 'conditions': [
scroggodf1c3372015-02-12 10:48:25 -080034 [ '"x86" in skia_arch_type and skia_os != "ios"', {
mtkleinf7069d52015-01-26 18:55:58 -080035 'cflags': [ '-msse2' ],
mtkleind1601922015-02-10 18:18:18 -080036 'dependencies': [ 'opts_ssse3', 'opts_sse41' ],
mtkleinf7069d52015-01-26 18:55:58 -080037 'sources': [ '<@(sse2_sources)' ],
mtkleinc98fe3a2015-01-26 18:05:37 -080038 }],
mtkleinf7069d52015-01-26 18:55:58 -080039
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) \
51 or (skia_os == "ios") \
scroggodf1c3372015-02-12 10:48:25 -080052 or (skia_os == "android" \
53 and skia_arch_type not in ["x86", "x86_64", "arm", "mips", \
54 "arm64"])', {
mtkleinf7069d52015-01-26 18:55:58 -080055 'sources': [ '<@(none_sources)' ],
56 }],
57
djsollen@google.comf7542ba2013-07-31 12:57:27 +000058 [ 'skia_arch_type == "arm" and arm_version >= 7', {
djsollen@google.com58629292011-11-03 13:08:29 +000059 # The assembly uses the frame pointer register (r7 in Thumb/r11 in
60 # ARM), the compiler doesn't like that.
mtkleinf7069d52015-01-26 18:55:58 -080061 '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.comeec9dbc2012-05-30 13:54:41 +000065 'conditions': [
66 [ 'arm_neon == 1 or arm_neon_optional == 1', {
mtkleinf7069d52015-01-26 18:55:58 -080067 'dependencies': [ 'opts_neon' ]
caryclark@google.com867cbd82012-09-20 15:45:41 +000068 }],
69 [ 'skia_os == "ios"', {
70 'sources!': [
caryclark@google.com594dd3c2012-09-24 19:33:57 +000071 # these fail to compile under xcode for ios
caryclark@google.com867cbd82012-09-20 15:45:41 +000072 '../src/opts/memset.arm.S',
caryclark@google.com594dd3c2012-09-24 19:33:57 +000073 '../src/opts/SkBitmapProcState_opts_arm.cpp',
74 '../src/opts/SkBlitRow_opts_arm.cpp',
caryclark@google.com867cbd82012-09-20 15:45:41 +000075 ],
76 }],
digit@google.comeec9dbc2012-05-30 13:54:41 +000077 ],
djsollen@google.com58629292011-11-03 13:08:29 +000078 }],
mtkleinf7069d52015-01-26 18:55:58 -080079
80 [ 'skia_arch_type == "arm64"', {
81 'sources': [ '<@(arm64_sources)' ],
djordje.pesut632a4542014-06-11 06:56:10 -070082 }],
mtkleinf7069d52015-01-26 18:55:58 -080083
commit-bot@chromium.orge72a4082014-02-28 16:07:39 +000084 [ 'skia_android_framework', {
85 'cflags!': [
86 '-msse2',
87 '-mfpu=neon',
88 '-fomit-frame-pointer',
commit-bot@chromium.orge72a4082014-02-28 16:07:39 +000089 ]
90 }],
epoger@google.comae85aea2011-05-31 13:50:51 +000091 ],
92 },
tomhudson@google.com95ad1552012-02-14 18:28:54 +000093 {
94 'target_name': 'opts_ssse3',
borenet@google.comefb1d772012-10-10 19:45:51 +000095 'product_name': 'skia_opts_ssse3',
tomhudson@google.com95ad1552012-02-14 18:28:54 +000096 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +000097 'standalone_static_library': 1,
mtkleinf7069d52015-01-26 18:55:58 -080098 'dependencies': [ 'core.gyp:*' ],
99 'include_dirs': [ '../src/core' ],
100 'sources': [ '<@(ssse3_sources)' ],
tomhudson@google.com95ad1552012-02-14 18:28:54 +0000101 'conditions': [
djsollenbc893292014-07-24 13:53:56 -0700102 [ 'skia_os == "win"', {
103 'defines' : [ 'SK_CPU_SSE_LEVEL=31' ],
104 }],
mtkleinf7069d52015-01-26 18:55:58 -0800105 [ 'not skia_android_framework', {
106 'cflags': [ '-mssse3' ],
tomhudson@google.com95ad1552012-02-14 18:28:54 +0000107 }],
tomhudson@google.com95ad1552012-02-14 18:28:54 +0000108 ],
109 },
henrik.smiding3bb195e2014-06-27 08:03:17 -0700110 {
mtkleinf7069d52015-01-26 18:55:58 -0800111 'target_name': 'opts_sse41',
112 'product_name': 'skia_opts_sse41',
henrik.smiding3bb195e2014-06-27 08:03:17 -0700113 'type': 'static_library',
114 'standalone_static_library': 1,
mtkleinf7069d52015-01-26 18:55:58 -0800115 'dependencies': [ 'core.gyp:*' ],
116 'sources': [ '<@(sse41_sources)' ],
henrik.smiding3bb195e2014-06-27 08:03:17 -0700117 'conditions': [
djsollenbc893292014-07-24 13:53:56 -0700118 [ 'skia_os == "win"', {
119 'defines' : [ 'SK_CPU_SSE_LEVEL=41' ],
120 }],
mtkleinf7069d52015-01-26 18:55:58 -0800121 [ 'not skia_android_framework', {
122 'cflags': [ '-msse4.1' ],
henrik.smiding3bb195e2014-06-27 08:03:17 -0700123 }],
henrik.smiding5f7f9d02014-07-07 08:05:40 -0700124 [ 'skia_os == "mac"', {
mtkleinf7069d52015-01-26 18:55:58 -0800125 'xcode_settings': { 'GCC_ENABLE_SSE41_EXTENSIONS': 'YES' },
henrik.smiding5f7f9d02014-07-07 08:05:40 -0700126 }],
henrik.smiding3bb195e2014-06-27 08:03:17 -0700127 ],
128 },
digit@google.comeec9dbc2012-05-30 13:54:41 +0000129 {
130 'target_name': 'opts_neon',
borenet@google.comefb1d772012-10-10 19:45:51 +0000131 'product_name': 'skia_opts_neon',
digit@google.comeec9dbc2012-05-30 13:54:41 +0000132 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +0000133 'standalone_static_library': 1,
bungeman@google.comb8f36552013-07-22 14:39:45 +0000134 'dependencies': [
135 'core.gyp:*',
senorblanco@chromium.org0ded88d2014-01-24 15:43:50 +0000136 'effects.gyp:*'
bungeman@google.comb8f36552013-07-22 14:39:45 +0000137 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000138 'include_dirs': [
digit@google.comeec9dbc2012-05-30 13:54:41 +0000139 '../src/core',
digit@google.comfce02ac2012-08-01 14:25:07 +0000140 '../src/opts',
krajcevski630598c2014-07-14 12:00:04 -0700141 '../src/utils',
digit@google.comeec9dbc2012-05-30 13:54:41 +0000142 ],
mtkleinf7069d52015-01-26 18:55:58 -0800143 'sources': [ '<@(neon_sources)' ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000144 'cflags!': [
145 '-fno-omit-frame-pointer',
146 '-mfpu=vfp', # remove them all, just in case.
147 '-mfpu=vfpv3',
148 '-mfpu=vfpv3-d16',
149 ],
commit-bot@chromium.orge72a4082014-02-28 16:07:39 +0000150 'conditions': [
151 [ 'not skia_android_framework', {
152 'cflags': [
153 '-mfpu=neon',
154 '-fomit-frame-pointer',
155 ],
156 }],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000157 ],
djsollen@google.com4dcc6242013-01-23 18:56:38 +0000158 'ldflags': [
159 '-march=armv7-a',
160 '-Wl,--fix-cortex-a8',
161 ],
digit@google.comeec9dbc2012-05-30 13:54:41 +0000162 },
epoger@google.comae85aea2011-05-31 13:50:51 +0000163 ],
164}