blob: e835e34850a77c320ea4709b596296f2060ac50c [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"', {
derekf29dda802014-10-01 10:52:52 -070014 'sources/': [ ['exclude', '_glx.(h|cpp)$'],
bsalomon@google.come2953132011-10-13 13:33:08 +000015 ],
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 }],
derekf29dda802014-10-01 10:52:52 -070029 ['skia_os == "nacl" or skia_egl == 0', {
30 'sources/': [ ['exclude', '_egl.(h|cpp)$'],
31 ],
32 }],
33 ['skia_os == "android"', {
34 'sources/': [ ['exclude', 'GrGLCreateNativeInterface_egl.cpp'],
35 ],
36 }],
37 ['skia_egl == 1', {
38 'sources/': [ ['exclude', '_glx.(h|cpp)$'],
39 ],
40 }],
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +000041 # nullify the targets in this gyp file if skia_gpu is 0
42 [ 'skia_gpu == 0', {
43 'sources/': [
44 ['exclude', '.*'],
45 ],
46 'defines/': [
47 ['exclude', '.*'],
48 ],
49 'include_dirs/': [
50 ['exclude', '.*'],
51 ],
52 'link_settings': {
53 'libraries/': [
54 ['exclude', '.*'],
55 ],
56 },
57 'direct_dependent_settings': {
58 'defines/': [
59 ['exclude', '.*'],
60 ],
61 'include_dirs/': [
62 ['exclude', '.*'],
63 ],
64 },
65 }],
bsalomon@google.come2953132011-10-13 13:33:08 +000066 ],
67 'direct_dependent_settings': {
68 'conditions': [
bsalomon@google.come2953132011-10-13 13:33:08 +000069 [ 'skia_os == "win"', {
70 'defines': [
bsalomon@google.come2953132011-10-13 13:33:08 +000071 'GR_GL_FUNCTION_TYPE=__stdcall',
72 ],
73 }],
74 ],
75 'include_dirs': [
76 '../include/gpu',
77 ],
78 },
79 },
epoger@google.comae85aea2011-05-31 13:50:51 +000080 'targets': [
81 {
robertphillips@google.come63296e2013-06-18 14:43:53 +000082 'target_name': 'skgpu',
83 'product_name': 'skia_skgpu',
epoger@google.comae85aea2011-05-31 13:50:51 +000084 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +000085 'standalone_static_library': 1,
bungeman@google.comb8f36552013-07-22 14:39:45 +000086 'dependencies': [
bungeman@google.comb8f36552013-07-22 14:39:45 +000087 'core.gyp:*',
88 'utils.gyp:*',
krajcevski9c0e6292014-06-02 07:38:14 -070089 'etc1.gyp:libetc1',
krajcevski99ffe242014-06-03 13:04:35 -070090 'ktx.gyp:libSkKTX',
bungeman@google.comb8f36552013-07-22 14:39:45 +000091 ],
bsalomon@google.com20806352012-08-23 12:55:01 +000092 'includes': [
93 'gpu.gypi',
94 ],
epoger@google.comae85aea2011-05-31 13:50:51 +000095 'include_dirs': [
bungeman@google.com899f1d82013-07-20 00:24:35 +000096 '../include/gpu',
bungeman@google.comb8f36552013-07-22 14:39:45 +000097 '../src/core',
bsalomon@google.com9c1f1ac2012-05-07 17:09:37 +000098 '../src/gpu',
robertphillips7b9e8a42014-12-11 08:20:31 -080099 '../src/image/',
epoger@google.comae85aea2011-05-31 13:50:51 +0000100 ],
101 'sources': [
robertphillips@google.come63296e2013-06-18 14:43:53 +0000102 '<@(skgpu_sources)',
103 '<@(skgpu_native_gl_sources)',
104 '<@(skgpu_angle_gl_sources)',
105 '<@(skgpu_mesa_gl_sources)',
106 '<@(skgpu_debug_gl_sources)',
107 '<@(skgpu_null_gl_sources)',
bsalomon@google.com202a51b2012-09-04 14:37:12 +0000108 'gpu.gypi', # Makes the gypi appear in IDEs (but does not modify the build).
epoger@google.comae85aea2011-05-31 13:50:51 +0000109 ],
epoger@google.comae85aea2011-05-31 13:50:51 +0000110 'conditions': [
sugoi@google.come3453cb2013-01-07 14:26:40 +0000111 [ 'skia_stroke_path_rendering', {
112 'sources': [
113 '../experimental/StrokePathRenderer/GrStrokePathRenderer.h',
114 '../experimental/StrokePathRenderer/GrStrokePathRenderer.cpp',
115 ],
116 'defines': [
117 'GR_STROKE_PATH_RENDERING=1',
118 ],
119 }],
jvanverth@google.com74dda902013-01-09 21:04:52 +0000120 [ 'skia_android_path_rendering', {
121 'sources': [
122 '../experimental/AndroidPathRenderer/GrAndroidPathRenderer.cpp',
123 '../experimental/AndroidPathRenderer/GrAndroidPathRenderer.h',
124 '../experimental/AndroidPathRenderer/AndroidPathRenderer.cpp',
125 '../experimental/AndroidPathRenderer/AndroidPathRenderer.h',
126 '../experimental/AndroidPathRenderer/Vertex.h',
127 ],
128 'defines': [
129 'GR_ANDROID_PATH_RENDERING=1',
130 ],
131 }],
robertphillips@google.com42cc2372013-12-10 15:19:32 +0000132 [ 'skia_chrome_utils', {
133 'sources': [
134 '../experimental/ChromeUtils/SkBorder.cpp',
135 '../experimental/ChromeUtils/SkBorder.h',
136 ],
137 'defines': [
138 'GR_CHROME_UTILS=1',
139 ],
140 }],
borenet@google.com05d550e2013-06-11 15:52:19 +0000141 [ 'skia_os == "linux" or skia_os == "chromeos"', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000142 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000143 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
144 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
epoger@google.comae85aea2011-05-31 13:50:51 +0000145 ],
derekf29dda802014-10-01 10:52:52 -0700146 }],
147 [ '(skia_os == "linux" or skia_os == "chromeos") and skia_egl == 1', {
148 'link_settings': {
149 'libraries': [
150 '-lEGL',
151 '-lGLESv2',
152 ],
153 },
154 }],
155 [ '(skia_os == "linux" or skia_os == "chromeos") and skia_egl == 0', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000156 'link_settings': {
157 'libraries': [
158 '-lGL',
borenet@google.com7158e6a2012-11-01 17:43:44 +0000159 '-lGLU',
senorblanco@chromium.org0d923532012-11-12 20:55:02 +0000160 '-lX11',
epoger@google.comae85aea2011-05-31 13:50:51 +0000161 ],
162 },
163 }],
borenet@google.com7158e6a2012-11-01 17:43:44 +0000164 [ 'skia_os == "nacl"', {
165 'link_settings': {
166 'libraries': [
167 '-lppapi_gles2',
168 ],
169 },
170 }],
derekf29dda802014-10-01 10:52:52 -0700171 [ 'skia_egl == 1', {
172 'defines': [
173 'SK_EGL=1',
174 ],
175 }],
176 [ 'skia_egl == 0', {
177 'defines': [
178 'SK_EGL=0',
179 ],
180 }],
bsalomon@google.com373a6632011-10-19 20:43:20 +0000181 [ 'skia_mesa and skia_os == "linux"', {
182 'link_settings': {
183 'libraries': [
184 '-lOSMesa',
185 ],
186 },
187 }],
epoger@google.com8846cb22011-07-01 20:20:07 +0000188 [ 'skia_os == "mac"', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000189 'link_settings': {
190 'libraries': [
191 '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
192 ],
193 },
194 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000195 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
196 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
epoger@google.comae85aea2011-05-31 13:50:51 +0000197 ],
bsalomon@google.com373a6632011-10-19 20:43:20 +0000198 }],
robertphillips@google.come63296e2013-06-18 14:43:53 +0000199 [ 'not skia_mesa', {
200 'sources!': [
201 '../src/gpu/gl/mesa/SkMesaGLContext.cpp',
202 '../src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp',
203 ],
204 }],
bsalomon@google.com373a6632011-10-19 20:43:20 +0000205 [ 'skia_mesa and skia_os == "mac"', {
206 'link_settings': {
207 'libraries': [
bsalomon@google.com71cf3ae2013-02-04 22:17:13 +0000208 '/opt/X11/lib/libOSMesa.dylib',
bsalomon@google.com373a6632011-10-19 20:43:20 +0000209 ],
210 },
211 'include_dirs': [
bsalomon@google.com71cf3ae2013-02-04 22:17:13 +0000212 '/opt/X11/include/',
bsalomon@google.com373a6632011-10-19 20:43:20 +0000213 ],
214 }],
bsalomon@google.comcca3c8f2012-09-28 16:56:28 +0000215 [ 'skia_os in ["win", "ios"]', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000216 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000217 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
218 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
epoger@google.comae85aea2011-05-31 13:50:51 +0000219 ],
220 }],
commit-bot@chromium.org9d0ecf42014-02-27 20:40:31 +0000221 [ 'skia_angle', {
222 'dependencies': [
223 'angle.gyp:*',
224 ],
225 'export_dependent_settings': [
226 'angle.gyp:*',
227 ],
228 }, { # not skia_angle
robertphillips@google.com021bce92012-04-02 20:42:26 +0000229 'sources!': [
robertphillips@google.come63296e2013-06-18 14:43:53 +0000230 '<@(skgpu_angle_gl_sources)',
djsollen@google.com403b90e2013-05-03 14:00:34 +0000231 ],
robertphillips@google.com021bce92012-04-02 20:42:26 +0000232 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000233 [ 'skia_os == "android"', {
234 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000235 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
236 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
djsollen@google.com58629292011-11-03 13:08:29 +0000237 ],
Derek Sollenbergerc7d29c82014-07-10 08:10:20 -0400238 'defines': [
239 'GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE=1',
240 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000241 'link_settings': {
242 'libraries': [
243 '-lGLESv2',
244 '-lEGL',
djsollen@google.com58629292011-11-03 13:08:29 +0000245 ],
246 },
247 }],
epoger@google.comae85aea2011-05-31 13:50:51 +0000248 ],
epoger@google.comae85aea2011-05-31 13:50:51 +0000249 },
250 ],
251}