• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# 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.
5# GYP for building gpu
6{
7  'target_defaults': {
8    'conditions': [
9      ['skia_os != "win"', {
10        'sources/': [ ['exclude', '_win.(h|cpp)$'],
11        ],
12      }],
13      ['skia_os != "mac"', {
14        'sources/': [ ['exclude', '_mac.(h|cpp|m|mm)$'],
15        ],
16      }],
17      ['skia_os != "linux" and skia_os != "chromeos"', {
18        'sources/': [ ['exclude', '_glx.(h|cpp)$'],
19        ],
20      }],
21      ['skia_os != "ios"', {
22        'sources/': [ ['exclude', '_iOS.(h|cpp|m|mm)$'],
23        ],
24      }],
25      ['skia_os != "android"', {
26        'sources/': [ ['exclude', '_android.(h|cpp)$'],
27        ],
28      }],
29      ['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      }],
41      # 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      }],
66    ],
67    'direct_dependent_settings': {
68      'conditions': [
69        [ 'skia_os == "win"', {
70          'defines': [
71            'GR_GL_FUNCTION_TYPE=__stdcall',
72          ],
73        }],
74      ],
75      'include_dirs': [
76        '../include/gpu',
77      ],
78    },
79  },
80  'targets': [
81    {
82      'target_name': 'skgpu',
83      'product_name': 'skia_skgpu',
84      'type': 'static_library',
85      'standalone_static_library': 1,
86      'dependencies': [
87        'core.gyp:*',
88        'utils.gyp:utils',
89        'etc1.gyp:libetc1',
90        'ktx.gyp:libSkKTX',
91      ],
92      'includes': [
93        'gpu.gypi',
94      ],
95      'include_dirs': [
96        '../include/gpu',
97        '../include/private',
98        '../src/core',
99        '../src/gpu',
100        '../src/image/',
101      ],
102      'sources': [
103        '<@(skgpu_sources)',
104        '<@(skgpu_native_gl_sources)',
105        '<@(skgpu_angle_gl_sources)',
106        '<@(skgpu_command_buffer_gl_sources)',
107        '<@(skgpu_mesa_gl_sources)',
108        '<@(skgpu_debug_gl_sources)',
109        '<@(skgpu_null_gl_sources)',
110        '<@(skgpu_vk_sources)',
111        'gpu.gypi', # Makes the gypi appear in IDEs (but does not modify the build).
112      ],
113      'conditions': [
114        [ 'skia_gpu_extra_dependency_path', {
115          'dependencies' : [
116              '<(skia_gpu_extra_dependency_path):*',
117          ],
118          'export_dependent_settings': [
119            '<(skia_gpu_extra_dependency_path):*',
120          ],
121        }],
122        [ 'skia_chrome_utils', {
123          'sources': [
124            '../experimental/ChromeUtils/SkBorder.cpp',
125            '../experimental/ChromeUtils/SkBorder.h',
126          ],
127          'defines': [
128            'GR_CHROME_UTILS=1',
129          ],
130        }],
131        [ 'skia_os == "linux" or skia_os == "chromeos"', {
132          'sources!': [
133            '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
134            '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
135          ],
136        }],
137        [ '(skia_os == "linux" or skia_os == "chromeos") and skia_egl == 1', {
138          'link_settings': {
139            'libraries': [
140              '-lEGL',
141              '-lGLESv2',
142            ],
143          },
144        }],
145        [ '(skia_os == "linux" or skia_os == "chromeos") and skia_egl == 0', {
146          'link_settings': {
147            'libraries': [
148              '-lGL',
149              '-lGLU',
150              '-lX11',
151            ],
152          },
153        }],
154        [ 'skia_egl == 1', {
155          'defines': [
156            'SK_EGL=1',
157          ],
158        }],
159        [ 'skia_egl == 0', {
160          'defines': [
161            'SK_EGL=0',
162          ],
163        }],
164        [ 'skia_mesa and skia_os == "linux"', {
165          'link_settings': {
166            'libraries': [
167              '-lOSMesa',
168            ],
169          },
170        }],
171        [ 'skia_os == "mac"', {
172          'link_settings': {
173            'libraries': [
174              '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
175            ],
176          },
177          'sources!': [
178            '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
179            '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
180          ],
181        }],
182        [ 'not skia_mesa', {
183          'sources!': [
184            '../src/gpu/gl/mesa/SkMesaGLContext.cpp',
185            '../src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp',
186          ],
187        }],
188        [ 'skia_mesa and skia_os == "mac"', {
189          'link_settings': {
190            'libraries': [
191              '/opt/X11/lib/libOSMesa.dylib',
192            ],
193          },
194          'include_dirs': [
195             '/opt/X11/include/',
196          ],
197        }],
198        [ 'skia_os in ["win", "ios"]', {
199          'sources!': [
200            '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
201            '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
202          ],
203        }],
204        [ 'skia_angle', {
205          'dependencies': [
206            'angle.gyp:*',
207          ],
208          'export_dependent_settings': [
209            'angle.gyp:*',
210          ],
211        }, { # not skia_angle
212          'sources!': [
213            '<@(skgpu_angle_gl_sources)',
214          ],
215        }],
216        [ 'skia_command_buffer', {
217        }, { # not skia_command_buffer
218          'sources!': [
219            '<@(skgpu_command_buffer_gl_sources)',
220          ],
221        }],
222        [ 'skia_os == "android"', {
223          'sources!': [
224            '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
225            '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
226          ],
227          'defines': [
228            'GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE=1',
229          ],
230          'link_settings': {
231            'libraries': [
232              '-lGLESv2',
233              '-lEGL',
234            ],
235          },
236        }],
237        [ 'skia_vulkan', {
238          'include_dirs': [
239            '../third_party/' # To include files under third_party/vulkan
240          ],
241          'direct_dependent_settings': {
242            'include_dirs': [
243              '../third_party/' # To include files under third_party/vulkan
244            ],
245          },
246          'conditions' : [
247            ['skia_os == "win"', {
248              'all_dependent_settings': {
249                'msvs_settings': {
250                  'VCLinkerTool': {
251                    'AdditionalDependencies': [
252                      'vulkan-1.lib',
253                      'shaderc_combined.lib'
254                    ],
255                  },
256                },
257              },
258              'link_settings': {
259                'configurations': {
260                  'Debug': {
261                    'msvs_settings': {
262                      'VCLinkerTool': {
263                      'AdditionalLibraryDirectories': [
264                          '../third_party/vulkan',
265                          '../third_party/shaderc/Debug',
266                        ],
267                      },
268                    },
269                  },
270                  'Release': {
271                    'msvs_settings': {
272                      'VCLinkerTool': {
273                        'AdditionalLibraryDirectories': [
274                          '../third_party/vulkan',
275                          '../third_party/shaderc/Release',
276                        ],
277                      },
278                    },
279                  },
280                  'Debug_x64': {
281                    'msvs_settings': {
282                      'VCLinkerTool': {
283                        'AdditionalLibraryDirectories': [
284                          '../third_party/vulkan',
285                          '../third_party/shaderc/Debug',
286                        ],
287                      },
288                    },
289                  },
290                  'Release_x64': {
291                      'msvs_settings': {
292                      'VCLinkerTool': {
293                        'AdditionalLibraryDirectories': [
294                          '../third_party/vulkan',
295                          '../third_party/shaderc/Release',
296                        ],
297                      },
298                    },
299                  },
300                },
301              },
302            }],
303          ],
304        }, {
305          'sources!': [
306            '<@(skgpu_vk_sources)',
307          ],
308        }],
309      ],
310    },
311  ],
312}
313