blob: a2909b802435c691ec99851e887fe9fdb3d3d6b3 [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 }],
borenet43bf5112016-04-29 14:01:34 -070017 ['skia_os != "linux"', {
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 }],
borenet48087572015-04-02 12:16:36 -070029 ['skia_egl == 0', {
derekf29dda802014-10-01 10:52:52 -070030 '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': {
bsalomon@google.come2953132011-10-13 13:33:08 +000068 'include_dirs': [
69 '../include/gpu',
70 ],
71 },
72 },
epoger@google.comae85aea2011-05-31 13:50:51 +000073 'targets': [
74 {
robertphillips@google.come63296e2013-06-18 14:43:53 +000075 'target_name': 'skgpu',
76 'product_name': 'skia_skgpu',
epoger@google.comae85aea2011-05-31 13:50:51 +000077 'type': 'static_library',
borenet@google.comefb1d772012-10-10 19:45:51 +000078 'standalone_static_library': 1,
bungeman@google.comb8f36552013-07-22 14:39:45 +000079 'dependencies': [
bungeman@google.comb8f36552013-07-22 14:39:45 +000080 'core.gyp:*',
tomhudsonf7edcde2015-03-23 12:51:20 -070081 'utils.gyp:utils',
krajcevski9c0e6292014-06-02 07:38:14 -070082 'etc1.gyp:libetc1',
krajcevski99ffe242014-06-03 13:04:35 -070083 'ktx.gyp:libSkKTX',
ethannicholasb3058bd2016-07-01 08:22:01 -070084 'sksl.gyp:sksl',
bungeman@google.comb8f36552013-07-22 14:39:45 +000085 ],
bsalomon@google.com20806352012-08-23 12:55:01 +000086 'includes': [
87 'gpu.gypi',
88 ],
epoger@google.comae85aea2011-05-31 13:50:51 +000089 'include_dirs': [
bungeman@google.com899f1d82013-07-20 00:24:35 +000090 '../include/gpu',
mtkleincd1f2da2015-07-28 08:55:14 -070091 '../include/private',
bungeman@google.comb8f36552013-07-22 14:39:45 +000092 '../src/core',
bsalomon@google.com9c1f1ac2012-05-07 17:09:37 +000093 '../src/gpu',
robertphillips7b9e8a42014-12-11 08:20:31 -080094 '../src/image/',
ethannicholasb3058bd2016-07-01 08:22:01 -070095 '../src/sksl',
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)',
bsalomon7499e692016-02-22 12:13:19 -0800100 '<@(skgpu_vk_sources)',
bsalomon@google.com202a51b2012-09-04 14:37:12 +0000101 'gpu.gypi', # Makes the gypi appear in IDEs (but does not modify the build).
epoger@google.comae85aea2011-05-31 13:50:51 +0000102 ],
epoger@google.comae85aea2011-05-31 13:50:51 +0000103 'conditions': [
egdaniel86e31a12015-03-09 09:40:42 -0700104 [ 'skia_gpu_extra_dependency_path', {
105 'dependencies' : [
106 '<(skia_gpu_extra_dependency_path):*',
egdaniel540e4882015-08-14 08:37:50 -0700107 ],
108 'export_dependent_settings': [
109 '<(skia_gpu_extra_dependency_path):*',
110 ],
egdaniel86e31a12015-03-09 09:40:42 -0700111 }],
robertphillips@google.com42cc2372013-12-10 15:19:32 +0000112 [ 'skia_chrome_utils', {
113 'sources': [
114 '../experimental/ChromeUtils/SkBorder.cpp',
115 '../experimental/ChromeUtils/SkBorder.h',
116 ],
117 'defines': [
118 'GR_CHROME_UTILS=1',
119 ],
120 }],
borenet43bf5112016-04-29 14:01:34 -0700121 [ 'skia_os == "linux"', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000122 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000123 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
124 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
epoger@google.comae85aea2011-05-31 13:50:51 +0000125 ],
derekf29dda802014-10-01 10:52:52 -0700126 }],
borenet43bf5112016-04-29 14:01:34 -0700127 [ 'skia_os == "linux" and skia_egl == 1', {
derekf29dda802014-10-01 10:52:52 -0700128 'link_settings': {
129 'libraries': [
130 '-lEGL',
131 '-lGLESv2',
132 ],
133 },
134 }],
borenet43bf5112016-04-29 14:01:34 -0700135 [ 'skia_os == "linux" and skia_egl == 0', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000136 'link_settings': {
137 'libraries': [
138 '-lGL',
borenet@google.com7158e6a2012-11-01 17:43:44 +0000139 '-lGLU',
senorblanco@chromium.org0d923532012-11-12 20:55:02 +0000140 '-lX11',
epoger@google.comae85aea2011-05-31 13:50:51 +0000141 ],
142 },
143 }],
epoger@google.com8846cb22011-07-01 20:20:07 +0000144 [ 'skia_os == "mac"', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000145 'link_settings': {
146 'libraries': [
147 '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
148 ],
149 },
150 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000151 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
152 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
epoger@google.comae85aea2011-05-31 13:50:51 +0000153 ],
bsalomon@google.com373a6632011-10-19 20:43:20 +0000154 }],
bsalomon@google.comcca3c8f2012-09-28 16:56:28 +0000155 [ 'skia_os in ["win", "ios"]', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000156 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000157 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
158 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
epoger@google.comae85aea2011-05-31 13:50:51 +0000159 ],
160 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000161 [ 'skia_os == "android"', {
162 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000163 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
164 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
djsollen@google.com58629292011-11-03 13:08:29 +0000165 ],
Derek Sollenbergerc7d29c82014-07-10 08:10:20 -0400166 'defines': [
167 'GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE=1',
168 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000169 'link_settings': {
170 'libraries': [
171 '-lGLESv2',
172 '-lEGL',
djsollen@google.com58629292011-11-03 13:08:29 +0000173 ],
174 },
175 }],
bsalomon7499e692016-02-22 12:13:19 -0800176 [ 'skia_vulkan', {
djsollend5fd2ff2016-07-06 09:17:35 -0700177 'link_settings': {
178 'libraries': [ '<(vulkan_lib_name)', ],
179 },
180 'dependencies': [
181 'shaderc.gyp:shaderc_combined',
182 ],
bsalomon41dc3d62016-03-04 13:38:26 -0800183 'conditions': [
184 [ 'skia_os == "win"', {
185 'variables': {
186 'vulkan_lib_name': '-lvulkan-1',
bsalomonf98bc6d2016-03-03 16:38:22 -0800187 'vulkan_sdk_path' : '<!(echo %VK_SDK_PATH%)',
bsalomon41dc3d62016-03-04 13:38:26 -0800188 },
189 'include_dirs': [
190 '<(vulkan_sdk_path)/Include',
191 ],
192 'direct_dependent_settings': {
193 'include_dirs': [
194 '<(vulkan_sdk_path)/Include',
195 ],
196 },
197 'link_settings': {
bsalomona6b439a2016-03-10 12:31:20 -0800198 'conditions': [
199 [ 'skia_arch_type == "x86"', {
200 'library_dirs': [ '<(vulkan_sdk_path)/Bin32', ],
201 }, {
202 'library_dirs': [ '<(vulkan_sdk_path)/Bin', ],
203 }],
204 ]
bsalomon41dc3d62016-03-04 13:38:26 -0800205 },
206 }, {
207 'variables': {
208 'vulkan_lib_name': '-lvulkan',
209 },
210 }],
egdaniel58daedb2016-06-17 12:04:05 -0700211 [ 'skia_os == "linux"', {
212 'variables': {
213 'vulkan_sdk_path' : '<!(echo $VULKAN_SDK)',
214 },
215 'include_dirs': [
216 '<(vulkan_sdk_path)/include',
217 ],
218 'direct_dependent_settings': {
219 'include_dirs': [
220 '<(vulkan_sdk_path)/include',
221 ],
222 },
223 'link_settings': {
224 'library_dirs': [ '<(vulkan_sdk_path)/lib', ],
225 },
226 }],
djsollend5fd2ff2016-07-06 09:17:35 -0700227 [ 'skia_android_framework', {
228 'include_dirs': [
229 'frameworks/native/vulkan/include',
230 '../tools/viewer/sk_app',
231 '../tools/viewer/sk_app/android',
232 ],
233 'direct_dependent_settings': {
234 'include_dirs': [
235 'frameworks/native/vulkan/include',
236 '../tools/viewer/sk_app',
237 '../tools/viewer/sk_app/android',
238 ],
239 },
240 'dependencies!': [
241 'shaderc.gyp:shaderc_combined',
242 ],
243 'sources': [
244 # the gyp -> android.mk generator doesn't seem to like cpp files
245 # in directories outside of src, bench, or dm. Until this gets fixed
246 # I just start the path in the src directory.
mtklein3d96cb82016-08-10 07:30:21 -0700247 '<(skia_src_path)/../tools/viewer/sk_app/WindowContext.cpp',
djsollend5fd2ff2016-07-06 09:17:35 -0700248 '<(skia_src_path)/../tools/viewer/sk_app/VulkanWindowContext.cpp',
249 '<(skia_src_path)/../tools/viewer/sk_app/android/VulkanWindowContext_android.cpp'
250 ],
251 }],
bsalomon41dc3d62016-03-04 13:38:26 -0800252 ],
bsalomon7499e692016-02-22 12:13:19 -0800253 }, {
254 'sources!': [
255 '<@(skgpu_vk_sources)',
256 ],
257 }],
epoger@google.comae85aea2011-05-31 13:50:51 +0000258 ],
epoger@google.comae85aea2011-05-31 13:50:51 +0000259 },
260 ],
261}