blob: 8e4cb070b295da5e2db9ad5056f6c236c175bb32 [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.
commit-bot@chromium.org9d0ecf42014-02-27 20:40:31 +00005# GYP for building gpu
epoger@google.comae85aea2011-05-31 13:50:51 +00006{
bsalomon@google.come2953132011-10-13 13:33:08 +00007 'target_defaults': {
8 'conditions': [
9 ['skia_os != "win"', {
10 'sources/': [ ['exclude', '_win.(h|cpp)$'],
11 ],
12 }],
13 ['skia_os != "mac"', {
bsalomon@google.com2b64f842012-10-02 15:25:12 +000014 'sources/': [ ['exclude', '_mac.(h|cpp|m|mm)$'],
bsalomon@google.come2953132011-10-13 13:33:08 +000015 ],
16 }],
borenet@google.com05d550e2013-06-11 15:52:19 +000017 ['skia_os != "linux" and skia_os != "chromeos"', {
derekf29dda802014-10-01 10:52:52 -070018 'sources/': [ ['exclude', '_glx.(h|cpp)$'],
bsalomon@google.come2953132011-10-13 13:33:08 +000019 ],
20 }],
21 ['skia_os != "ios"', {
bsalomon@google.com2b64f842012-10-02 15:25:12 +000022 'sources/': [ ['exclude', '_iOS.(h|cpp|m|mm)$'],
bsalomon@google.come2953132011-10-13 13:33:08 +000023 ],
24 }],
25 ['skia_os != "android"', {
26 'sources/': [ ['exclude', '_android.(h|cpp)$'],
27 ],
28 }],
borenet@google.com7158e6a2012-11-01 17:43:44 +000029 ['skia_os != "nacl"', {
30 'sources/': [ ['exclude', '_nacl.(h|cpp)$'],
31 ],
32 }],
derekf29dda802014-10-01 10:52:52 -070033 ['skia_os == "nacl" or skia_egl == 0', {
34 'sources/': [ ['exclude', '_egl.(h|cpp)$'],
35 ],
36 }],
37 ['skia_os == "android"', {
38 'sources/': [ ['exclude', 'GrGLCreateNativeInterface_egl.cpp'],
39 ],
40 }],
41 ['skia_egl == 1', {
42 'sources/': [ ['exclude', '_glx.(h|cpp)$'],
43 ],
44 }],
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +000045 # nullify the targets in this gyp file if skia_gpu is 0
46 [ 'skia_gpu == 0', {
47 'sources/': [
48 ['exclude', '.*'],
49 ],
50 'defines/': [
51 ['exclude', '.*'],
52 ],
53 'include_dirs/': [
54 ['exclude', '.*'],
55 ],
56 'link_settings': {
57 'libraries/': [
58 ['exclude', '.*'],
59 ],
60 },
61 'direct_dependent_settings': {
62 'defines/': [
63 ['exclude', '.*'],
64 ],
65 'include_dirs/': [
66 ['exclude', '.*'],
67 ],
68 },
69 }],
bsalomon@google.come2953132011-10-13 13:33:08 +000070 ],
71 'direct_dependent_settings': {
72 'conditions': [
bsalomon@google.come2953132011-10-13 13:33:08 +000073 [ 'skia_os == "win"', {
74 'defines': [
bsalomon@google.come2953132011-10-13 13:33:08 +000075 'GR_GL_FUNCTION_TYPE=__stdcall',
76 ],
77 }],
78 ],
79 'include_dirs': [
80 '../include/gpu',
81 ],
82 },
83 },
epoger@google.comae85aea2011-05-31 13:50:51 +000084 'targets': [
85 {
robertphillips@google.come63296e2013-06-18 14:43:53 +000086 'target_name': 'skgpu',
87 'product_name': 'skia_skgpu',
epoger@google.comae85aea2011-05-31 13:50:51 +000088 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +000089 'standalone_static_library': 1,
bungeman@google.comb8f36552013-07-22 14:39:45 +000090 'dependencies': [
bungeman@google.comb8f36552013-07-22 14:39:45 +000091 'core.gyp:*',
tomhudsonf7edcde2015-03-23 12:51:20 -070092 'utils.gyp:utils',
krajcevski9c0e6292014-06-02 07:38:14 -070093 'etc1.gyp:libetc1',
krajcevski99ffe242014-06-03 13:04:35 -070094 'ktx.gyp:libSkKTX',
bungeman@google.comb8f36552013-07-22 14:39:45 +000095 ],
bsalomon@google.com20806352012-08-23 12:55:01 +000096 'includes': [
97 'gpu.gypi',
98 ],
epoger@google.comae85aea2011-05-31 13:50:51 +000099 'include_dirs': [
bungeman@google.com899f1d82013-07-20 00:24:35 +0000100 '../include/gpu',
bungeman@google.comb8f36552013-07-22 14:39:45 +0000101 '../src/core',
bsalomon@google.com9c1f1ac2012-05-07 17:09:37 +0000102 '../src/gpu',
robertphillips7b9e8a42014-12-11 08:20:31 -0800103 '../src/image/',
epoger@google.comae85aea2011-05-31 13:50:51 +0000104 ],
105 'sources': [
robertphillips@google.come63296e2013-06-18 14:43:53 +0000106 '<@(skgpu_sources)',
107 '<@(skgpu_native_gl_sources)',
108 '<@(skgpu_angle_gl_sources)',
109 '<@(skgpu_mesa_gl_sources)',
110 '<@(skgpu_debug_gl_sources)',
111 '<@(skgpu_null_gl_sources)',
bsalomon@google.com202a51b2012-09-04 14:37:12 +0000112 'gpu.gypi', # Makes the gypi appear in IDEs (but does not modify the build).
epoger@google.comae85aea2011-05-31 13:50:51 +0000113 ],
epoger@google.comae85aea2011-05-31 13:50:51 +0000114 'conditions': [
egdaniel86e31a12015-03-09 09:40:42 -0700115 [ 'skia_gpu_extra_dependency_path', {
116 'dependencies' : [
117 '<(skia_gpu_extra_dependency_path):*',
118 ]
119 }],
sugoi@google.come3453cb2013-01-07 14:26:40 +0000120 [ 'skia_stroke_path_rendering', {
121 'sources': [
122 '../experimental/StrokePathRenderer/GrStrokePathRenderer.h',
123 '../experimental/StrokePathRenderer/GrStrokePathRenderer.cpp',
124 ],
125 'defines': [
126 'GR_STROKE_PATH_RENDERING=1',
127 ],
128 }],
jvanverth@google.com74dda902013-01-09 21:04:52 +0000129 [ 'skia_android_path_rendering', {
130 'sources': [
131 '../experimental/AndroidPathRenderer/GrAndroidPathRenderer.cpp',
132 '../experimental/AndroidPathRenderer/GrAndroidPathRenderer.h',
133 '../experimental/AndroidPathRenderer/AndroidPathRenderer.cpp',
134 '../experimental/AndroidPathRenderer/AndroidPathRenderer.h',
135 '../experimental/AndroidPathRenderer/Vertex.h',
136 ],
137 'defines': [
138 'GR_ANDROID_PATH_RENDERING=1',
139 ],
140 }],
robertphillips@google.com42cc2372013-12-10 15:19:32 +0000141 [ 'skia_chrome_utils', {
142 'sources': [
143 '../experimental/ChromeUtils/SkBorder.cpp',
144 '../experimental/ChromeUtils/SkBorder.h',
145 ],
146 'defines': [
147 'GR_CHROME_UTILS=1',
148 ],
149 }],
borenet@google.com05d550e2013-06-11 15:52:19 +0000150 [ 'skia_os == "linux" or skia_os == "chromeos"', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000151 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000152 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
153 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
epoger@google.comae85aea2011-05-31 13:50:51 +0000154 ],
derekf29dda802014-10-01 10:52:52 -0700155 }],
156 [ '(skia_os == "linux" or skia_os == "chromeos") and skia_egl == 1', {
157 'link_settings': {
158 'libraries': [
159 '-lEGL',
160 '-lGLESv2',
161 ],
162 },
163 }],
164 [ '(skia_os == "linux" or skia_os == "chromeos") and skia_egl == 0', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000165 'link_settings': {
166 'libraries': [
167 '-lGL',
borenet@google.com7158e6a2012-11-01 17:43:44 +0000168 '-lGLU',
senorblanco@chromium.org0d923532012-11-12 20:55:02 +0000169 '-lX11',
epoger@google.comae85aea2011-05-31 13:50:51 +0000170 ],
171 },
172 }],
borenet@google.com7158e6a2012-11-01 17:43:44 +0000173 [ 'skia_os == "nacl"', {
174 'link_settings': {
175 'libraries': [
176 '-lppapi_gles2',
177 ],
178 },
179 }],
derekf29dda802014-10-01 10:52:52 -0700180 [ 'skia_egl == 1', {
181 'defines': [
182 'SK_EGL=1',
183 ],
184 }],
185 [ 'skia_egl == 0', {
186 'defines': [
187 'SK_EGL=0',
188 ],
189 }],
bsalomon@google.com373a6632011-10-19 20:43:20 +0000190 [ 'skia_mesa and skia_os == "linux"', {
191 'link_settings': {
192 'libraries': [
193 '-lOSMesa',
194 ],
195 },
196 }],
epoger@google.com8846cb22011-07-01 20:20:07 +0000197 [ 'skia_os == "mac"', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000198 'link_settings': {
199 'libraries': [
200 '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
201 ],
202 },
203 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000204 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
205 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
epoger@google.comae85aea2011-05-31 13:50:51 +0000206 ],
bsalomon@google.com373a6632011-10-19 20:43:20 +0000207 }],
robertphillips@google.come63296e2013-06-18 14:43:53 +0000208 [ 'not skia_mesa', {
209 'sources!': [
210 '../src/gpu/gl/mesa/SkMesaGLContext.cpp',
211 '../src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp',
212 ],
213 }],
bsalomon@google.com373a6632011-10-19 20:43:20 +0000214 [ 'skia_mesa and skia_os == "mac"', {
215 'link_settings': {
216 'libraries': [
bsalomon@google.com71cf3ae2013-02-04 22:17:13 +0000217 '/opt/X11/lib/libOSMesa.dylib',
bsalomon@google.com373a6632011-10-19 20:43:20 +0000218 ],
219 },
220 'include_dirs': [
bsalomon@google.com71cf3ae2013-02-04 22:17:13 +0000221 '/opt/X11/include/',
bsalomon@google.com373a6632011-10-19 20:43:20 +0000222 ],
223 }],
bsalomon@google.comcca3c8f2012-09-28 16:56:28 +0000224 [ 'skia_os in ["win", "ios"]', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000225 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000226 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
227 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
epoger@google.comae85aea2011-05-31 13:50:51 +0000228 ],
229 }],
commit-bot@chromium.org9d0ecf42014-02-27 20:40:31 +0000230 [ 'skia_angle', {
231 'dependencies': [
232 'angle.gyp:*',
233 ],
234 'export_dependent_settings': [
235 'angle.gyp:*',
236 ],
237 }, { # not skia_angle
robertphillips@google.com021bce92012-04-02 20:42:26 +0000238 'sources!': [
robertphillips@google.come63296e2013-06-18 14:43:53 +0000239 '<@(skgpu_angle_gl_sources)',
djsollen@google.com403b90e2013-05-03 14:00:34 +0000240 ],
robertphillips@google.com021bce92012-04-02 20:42:26 +0000241 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000242 [ 'skia_os == "android"', {
243 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000244 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
245 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
djsollen@google.com58629292011-11-03 13:08:29 +0000246 ],
Derek Sollenbergerc7d29c82014-07-10 08:10:20 -0400247 'defines': [
248 'GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE=1',
249 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000250 'link_settings': {
251 'libraries': [
252 '-lGLESv2',
253 '-lEGL',
djsollen@google.com58629292011-11-03 13:08:29 +0000254 ],
255 },
256 }],
epoger@google.comae85aea2011-05-31 13:50:51 +0000257 ],
epoger@google.comae85aea2011-05-31 13:50:51 +0000258 },
259 ],
260}