• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2  'target_defaults': {
3    'conditions': [
4      ['skia_os != "win"', {
5        'sources/': [ ['exclude', '_win.(h|cpp)$'],
6        ],
7      }],
8      ['skia_os != "mac"', {
9        'sources/': [ ['exclude', '_mac.(h|cpp|m|mm)$'],
10        ],
11      }],
12      ['skia_os != "linux"', {
13        'sources/': [ ['exclude', '_unix.(h|cpp)$'],
14        ],
15      }],
16      ['skia_os != "ios"', {
17        'sources/': [ ['exclude', '_iOS.(h|cpp|m|mm)$'],
18        ],
19      }],
20      ['skia_os != "android"', {
21        'sources/': [ ['exclude', '_android.(h|cpp)$'],
22        ],
23      }],
24      ['skia_os != "nacl"', {
25        'sources/': [ ['exclude', '_nacl.(h|cpp)$'],
26        ],
27      }],
28      [ 'skia_os == "android"', {
29        'defines': [
30          'GR_ANDROID_BUILD=1',
31        ],
32      }],
33      [ 'skia_os == "mac"', {
34        'defines': [
35          'GR_MAC_BUILD=1',
36        ],
37      }],
38      [ 'skia_os == "linux"', {
39        'defines': [
40          'GR_LINUX_BUILD=1',
41        ],
42      }],
43      [ 'skia_os == "ios"', {
44        'defines': [
45          'GR_IOS_BUILD=1',
46        ],
47      }],
48      [ 'skia_os == "win"', {
49        'defines': [
50          'GR_WIN32_BUILD=1',
51        ],
52      }],
53      # nullify the targets in this gyp file if skia_gpu is 0
54      [ 'skia_gpu == 0', {
55        'sources/': [
56          ['exclude', '.*'],
57        ],
58        'defines/': [
59          ['exclude', '.*'],
60        ],
61        'include_dirs/': [
62           ['exclude', '.*'],
63        ],
64        'link_settings': {
65          'libraries/': [
66            ['exclude', '.*'],
67          ],
68        },
69        'direct_dependent_settings': {
70          'defines/': [
71            ['exclude', '.*'],
72          ],
73          'include_dirs/': [
74            ['exclude', '.*'],
75          ],
76        },
77      }],
78      [ 'skia_texture_cache_mb_limit != 0', {
79        'defines': [
80          'GR_DEFAULT_TEXTURE_CACHE_MB_LIMIT=<(skia_texture_cache_mb_limit)',
81        ],
82      }],
83    ],
84    'direct_dependent_settings': {
85      'conditions': [
86        [ 'skia_os == "android"', {
87          'defines': [
88            'GR_ANDROID_BUILD=1',
89          ],
90        }],
91        [ 'skia_os == "mac"', {
92          'defines': [
93            'GR_MAC_BUILD=1',
94          ],
95        }],
96        [ 'skia_os == "linux"', {
97          'defines': [
98            'GR_LINUX_BUILD=1',
99          ],
100        }],
101        [ 'skia_os == "ios"', {
102          'defines': [
103            'GR_IOS_BUILD=1',
104          ],
105        }],
106        [ 'skia_os == "win"', {
107          'defines': [
108            'GR_WIN32_BUILD=1',
109            'GR_GL_FUNCTION_TYPE=__stdcall',
110          ],
111        }],
112      ],
113      'include_dirs': [
114        '../include/gpu',
115      ],
116    },
117  },
118  'targets': [
119    {
120      'target_name': 'skgr',
121      'product_name': 'skia_skgr',
122      'type': 'static_library',
123      'standalone_static_library': 1,
124      'includes': [
125        'gpu.gypi',
126      ],
127      'include_dirs': [
128        '../include/config',
129        '../include/core',
130        '../include/utils',
131        '../src/core',
132        '../include/gpu',
133        '../src/gpu',
134      ],
135      'dependencies': [
136        'angle.gyp:*',
137      ],
138      'export_dependent_settings': [
139        'angle.gyp:*',
140      ],
141      'sources': [
142        '<@(skgr_sources)',
143        '<@(skgr_native_gl_sources)',
144        '<@(skgr_angle_gl_sources)',
145        '<@(skgr_mesa_gl_sources)',
146        '<@(skgr_debug_gl_sources)',
147        '<@(skgr_null_gl_sources)',
148        'gpu.gypi', # Makes the gypi appear in IDEs (but does not modify the build).
149      ],
150      'conditions': [
151        [ 'not skia_mesa', {
152          'sources!': [
153            '../src/gpu/gl/mesa/SkMesaGLContext.cpp',
154          ],
155        }],
156        [ 'skia_mesa and skia_os == "mac"', {
157          'include_dirs': [
158             '$(SDKROOT)/usr/X11/include/',
159          ],
160        }],
161        [ 'not skia_angle', {
162          'sources!': [
163            '../include/gpu/gl/SkANGLEGLContext.h',
164            '../src/gpu/gl/angle/SkANGLEGLContext.cpp',
165            '../src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp',
166          ],
167        }],
168      ],
169    },
170    {
171      'target_name': 'gr',
172      'product_name': 'skia_gr',
173      'type': 'static_library',
174      'standalone_static_library': 1,
175      'includes': [
176        'gpu.gypi',
177      ],
178     'include_dirs': [
179        '../include/core',
180        '../include/config',
181        '../include/utils',
182        '../include/gpu',
183        '../src/core', # SkRasterClip.h
184        '../src/gpu'
185      ],
186      'dependencies': [
187        'angle.gyp:*',
188      ],
189      'export_dependent_settings': [
190        'angle.gyp:*',
191      ],
192      'sources': [
193        '<@(gr_sources)',
194        '<@(gr_native_gl_sources)',
195        '<@(gr_angle_gl_sources)',
196        '<@(gr_mesa_gl_sources)',
197        '<@(gr_debug_gl_sources)',
198        '<@(gr_null_gl_sources)',
199        'gpu.gypi', # Makes the gypi appear in IDEs (but does not modify the build).
200      ],
201      'defines': [
202        'GR_IMPLEMENTATION=1',
203      ],
204      'conditions': [
205        [ 'skia_nv_path_rendering', {
206          'defines': [
207            'GR_GL_USE_NV_PATH_RENDERING=1',
208          ],
209        }],
210        [ 'skia_stroke_path_rendering', {
211          'sources': [
212            '../experimental/StrokePathRenderer/GrStrokePathRenderer.h',
213            '../experimental/StrokePathRenderer/GrStrokePathRenderer.cpp',
214          ],
215          'defines': [
216            'GR_STROKE_PATH_RENDERING=1',
217          ],
218        }],
219        [ 'skia_android_path_rendering', {
220          'sources': [
221            '../experimental/AndroidPathRenderer/GrAndroidPathRenderer.cpp',
222            '../experimental/AndroidPathRenderer/GrAndroidPathRenderer.h',
223            '../experimental/AndroidPathRenderer/AndroidPathRenderer.cpp',
224            '../experimental/AndroidPathRenderer/AndroidPathRenderer.h',
225            '../experimental/AndroidPathRenderer/Vertex.h',
226          ],
227          'defines': [
228            'GR_ANDROID_PATH_RENDERING=1',
229          ],
230        }],
231        [ 'skia_os == "linux"', {
232          'sources!': [
233            '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
234            '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
235          ],
236          'link_settings': {
237            'libraries': [
238              '-lGL',
239              '-lGLU',
240              '-lX11',
241            ],
242          },
243        }],
244        [ 'skia_os == "nacl"', {
245          'link_settings': {
246            'libraries': [
247              '-lppapi_gles2',
248            ],
249          },
250        }],
251        [ 'skia_mesa and skia_os == "linux"', {
252          'link_settings': {
253            'libraries': [
254              '-lOSMesa',
255            ],
256          },
257        }],
258        [ 'skia_os == "mac"', {
259          'link_settings': {
260            'libraries': [
261              '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
262            ],
263          },
264          'sources!': [
265            '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
266            '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
267          ],
268        }],
269        [ 'skia_mesa and skia_os == "mac"', {
270          'link_settings': {
271            'libraries': [
272              '$(SDKROOT)/usr/X11/lib/libOSMesa.dylib',
273            ],
274          },
275          'include_dirs': [
276             '$(SDKROOT)/usr/X11/include/',
277          ],
278        }],
279        [ 'not skia_mesa', {
280          'sources!': [
281            '../src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp',
282          ],
283        }],
284        [ 'skia_os in ["win", "ios"]', {
285          'sources!': [
286            '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
287            '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
288          ],
289        }],
290        [ 'not skia_angle', {
291          'sources!': [
292            '../include/gpu/gl/SkANGLEGLContext.h',
293
294            '../src/gpu/gl/angle/GrGLCreateANGLEInterface.cpp',
295            '../src/gpu/gl/angle/SkANGLEGLContext.cpp',
296          ],
297        }],
298        [ 'skia_os == "android"', {
299          'sources!': [
300            '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
301            '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
302          ],
303          'link_settings': {
304            'libraries': [
305              '-lGLESv2',
306              '-lEGL',
307            ],
308          },
309        }],
310      ],
311    },
312  ],
313}
314
315# Local Variables:
316# tab-width:2
317# indent-tabs-mode:nil
318# End:
319# vim: set expandtab tabstop=2 shiftwidth=2:
320