blob: fd81d6031432cdfd600fe343386d7c111fe91d7b [file] [log] [blame]
commit-bot@chromium.org9d0ecf42014-02-27 20:40:31 +00001# GYP for building gpu
epoger@google.comae85aea2011-05-31 13:50:51 +00002{
bsalomon@google.come2953132011-10-13 13:33:08 +00003 'target_defaults': {
4 'conditions': [
5 ['skia_os != "win"', {
6 'sources/': [ ['exclude', '_win.(h|cpp)$'],
7 ],
8 }],
9 ['skia_os != "mac"', {
bsalomon@google.com2b64f842012-10-02 15:25:12 +000010 'sources/': [ ['exclude', '_mac.(h|cpp|m|mm)$'],
bsalomon@google.come2953132011-10-13 13:33:08 +000011 ],
12 }],
borenet@google.com05d550e2013-06-11 15:52:19 +000013 ['skia_os != "linux" and skia_os != "chromeos"', {
bsalomon@google.come2953132011-10-13 13:33:08 +000014 'sources/': [ ['exclude', '_unix.(h|cpp)$'],
15 ],
16 }],
17 ['skia_os != "ios"', {
bsalomon@google.com2b64f842012-10-02 15:25:12 +000018 'sources/': [ ['exclude', '_iOS.(h|cpp|m|mm)$'],
bsalomon@google.come2953132011-10-13 13:33:08 +000019 ],
20 }],
21 ['skia_os != "android"', {
22 'sources/': [ ['exclude', '_android.(h|cpp)$'],
23 ],
24 }],
borenet@google.com7158e6a2012-11-01 17:43:44 +000025 ['skia_os != "nacl"', {
26 'sources/': [ ['exclude', '_nacl.(h|cpp)$'],
27 ],
28 }],
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +000029 # nullify the targets in this gyp file if skia_gpu is 0
30 [ 'skia_gpu == 0', {
31 'sources/': [
32 ['exclude', '.*'],
33 ],
34 'defines/': [
35 ['exclude', '.*'],
36 ],
37 'include_dirs/': [
38 ['exclude', '.*'],
39 ],
40 'link_settings': {
41 'libraries/': [
42 ['exclude', '.*'],
43 ],
44 },
45 'direct_dependent_settings': {
46 'defines/': [
47 ['exclude', '.*'],
48 ],
49 'include_dirs/': [
50 ['exclude', '.*'],
51 ],
52 },
53 }],
robertphillips@google.com4e5559a2013-10-30 17:04:16 +000054 [ 'skia_resource_cache_mb_limit != 0', {
djsollen@google.com42041e62012-10-29 19:24:45 +000055 'defines': [
robertphillips@google.com4e5559a2013-10-30 17:04:16 +000056 'GR_DEFAULT_RESOURCE_CACHE_MB_LIMIT=<(skia_resource_cache_mb_limit)',
57 ],
58 }],
59 [ 'skia_resource_cache_count_limit != 0', {
60 'defines': [
61 'GR_DEFAULT_RESOURCE_CACHE_COUNT_LIMIT=<(skia_resource_cache_count_limit)',
djsollen@google.com42041e62012-10-29 19:24:45 +000062 ],
63 }],
bsalomon@google.come2953132011-10-13 13:33:08 +000064 ],
65 'direct_dependent_settings': {
66 'conditions': [
bsalomon@google.come2953132011-10-13 13:33:08 +000067 [ 'skia_os == "win"', {
68 'defines': [
bsalomon@google.come2953132011-10-13 13:33:08 +000069 'GR_GL_FUNCTION_TYPE=__stdcall',
70 ],
71 }],
72 ],
73 'include_dirs': [
74 '../include/gpu',
75 ],
76 },
77 },
epoger@google.comae85aea2011-05-31 13:50:51 +000078 'targets': [
79 {
robertphillips@google.come63296e2013-06-18 14:43:53 +000080 'target_name': 'skgpu',
81 'product_name': 'skia_skgpu',
epoger@google.comae85aea2011-05-31 13:50:51 +000082 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +000083 'standalone_static_library': 1,
bungeman@google.comb8f36552013-07-22 14:39:45 +000084 'dependencies': [
bungeman@google.comb8f36552013-07-22 14:39:45 +000085 'core.gyp:*',
86 'utils.gyp:*',
krajcevski9c0e6292014-06-02 07:38:14 -070087 'etc1.gyp:libetc1',
bungeman@google.comb8f36552013-07-22 14:39:45 +000088 ],
bsalomon@google.com20806352012-08-23 12:55:01 +000089 'includes': [
90 'gpu.gypi',
91 ],
epoger@google.comae85aea2011-05-31 13:50:51 +000092 'include_dirs': [
bungeman@google.com899f1d82013-07-20 00:24:35 +000093 '../include/gpu',
bungeman@google.comb8f36552013-07-22 14:39:45 +000094 '../src/core',
bsalomon@google.com9c1f1ac2012-05-07 17:09:37 +000095 '../src/gpu',
epoger@google.comae85aea2011-05-31 13:50:51 +000096 ],
97 'sources': [
robertphillips@google.come63296e2013-06-18 14:43:53 +000098 '<@(skgpu_sources)',
99 '<@(skgpu_native_gl_sources)',
100 '<@(skgpu_angle_gl_sources)',
101 '<@(skgpu_mesa_gl_sources)',
102 '<@(skgpu_debug_gl_sources)',
103 '<@(skgpu_null_gl_sources)',
bsalomon@google.com202a51b2012-09-04 14:37:12 +0000104 'gpu.gypi', # Makes the gypi appear in IDEs (but does not modify the build).
epoger@google.comae85aea2011-05-31 13:50:51 +0000105 ],
epoger@google.comae85aea2011-05-31 13:50:51 +0000106 'conditions': [
sugoi@google.come3453cb2013-01-07 14:26:40 +0000107 [ 'skia_stroke_path_rendering', {
108 'sources': [
109 '../experimental/StrokePathRenderer/GrStrokePathRenderer.h',
110 '../experimental/StrokePathRenderer/GrStrokePathRenderer.cpp',
111 ],
112 'defines': [
113 'GR_STROKE_PATH_RENDERING=1',
114 ],
115 }],
jvanverth@google.com74dda902013-01-09 21:04:52 +0000116 [ 'skia_android_path_rendering', {
117 'sources': [
118 '../experimental/AndroidPathRenderer/GrAndroidPathRenderer.cpp',
119 '../experimental/AndroidPathRenderer/GrAndroidPathRenderer.h',
120 '../experimental/AndroidPathRenderer/AndroidPathRenderer.cpp',
121 '../experimental/AndroidPathRenderer/AndroidPathRenderer.h',
122 '../experimental/AndroidPathRenderer/Vertex.h',
123 ],
124 'defines': [
125 'GR_ANDROID_PATH_RENDERING=1',
126 ],
127 }],
robertphillips@google.com42cc2372013-12-10 15:19:32 +0000128 [ 'skia_chrome_utils', {
129 'sources': [
130 '../experimental/ChromeUtils/SkBorder.cpp',
131 '../experimental/ChromeUtils/SkBorder.h',
132 ],
133 'defines': [
134 'GR_CHROME_UTILS=1',
135 ],
136 }],
borenet@google.com05d550e2013-06-11 15:52:19 +0000137 [ 'skia_os == "linux" or skia_os == "chromeos"', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000138 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000139 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
140 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
epoger@google.comae85aea2011-05-31 13:50:51 +0000141 ],
142 'link_settings': {
143 'libraries': [
144 '-lGL',
borenet@google.com7158e6a2012-11-01 17:43:44 +0000145 '-lGLU',
senorblanco@chromium.org0d923532012-11-12 20:55:02 +0000146 '-lX11',
epoger@google.comae85aea2011-05-31 13:50:51 +0000147 ],
148 },
149 }],
borenet@google.com7158e6a2012-11-01 17:43:44 +0000150 [ 'skia_os == "nacl"', {
151 'link_settings': {
152 'libraries': [
153 '-lppapi_gles2',
154 ],
155 },
156 }],
bsalomon@google.com373a6632011-10-19 20:43:20 +0000157 [ 'skia_mesa and skia_os == "linux"', {
158 'link_settings': {
159 'libraries': [
160 '-lOSMesa',
161 ],
162 },
163 }],
epoger@google.com8846cb22011-07-01 20:20:07 +0000164 [ 'skia_os == "mac"', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000165 'link_settings': {
166 'libraries': [
167 '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
168 ],
169 },
170 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000171 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
172 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
epoger@google.comae85aea2011-05-31 13:50:51 +0000173 ],
bsalomon@google.com373a6632011-10-19 20:43:20 +0000174 }],
robertphillips@google.come63296e2013-06-18 14:43:53 +0000175 [ 'not skia_mesa', {
176 'sources!': [
177 '../src/gpu/gl/mesa/SkMesaGLContext.cpp',
178 '../src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp',
179 ],
180 }],
bsalomon@google.com373a6632011-10-19 20:43:20 +0000181 [ 'skia_mesa and skia_os == "mac"', {
182 'link_settings': {
183 'libraries': [
bsalomon@google.com71cf3ae2013-02-04 22:17:13 +0000184 '/opt/X11/lib/libOSMesa.dylib',
bsalomon@google.com373a6632011-10-19 20:43:20 +0000185 ],
186 },
187 'include_dirs': [
bsalomon@google.com71cf3ae2013-02-04 22:17:13 +0000188 '/opt/X11/include/',
bsalomon@google.com373a6632011-10-19 20:43:20 +0000189 ],
190 }],
bsalomon@google.comcca3c8f2012-09-28 16:56:28 +0000191 [ 'skia_os in ["win", "ios"]', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000192 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000193 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
194 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
epoger@google.comae85aea2011-05-31 13:50:51 +0000195 ],
196 }],
commit-bot@chromium.org9d0ecf42014-02-27 20:40:31 +0000197 [ 'skia_angle', {
198 'dependencies': [
199 'angle.gyp:*',
200 ],
201 'export_dependent_settings': [
202 'angle.gyp:*',
203 ],
204 }, { # not skia_angle
robertphillips@google.com021bce92012-04-02 20:42:26 +0000205 'sources!': [
robertphillips@google.come63296e2013-06-18 14:43:53 +0000206 '<@(skgpu_angle_gl_sources)',
djsollen@google.com403b90e2013-05-03 14:00:34 +0000207 ],
robertphillips@google.com021bce92012-04-02 20:42:26 +0000208 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000209 [ 'skia_os == "android"', {
210 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000211 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
212 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
djsollen@google.com58629292011-11-03 13:08:29 +0000213 ],
214 'link_settings': {
215 'libraries': [
216 '-lGLESv2',
217 '-lEGL',
djsollen@google.com58629292011-11-03 13:08:29 +0000218 ],
219 },
220 }],
epoger@google.comae85aea2011-05-31 13:50:51 +0000221 ],
epoger@google.comae85aea2011-05-31 13:50:51 +0000222 },
223 ],
224}