blob: 2fedbed93c058d05fa75f8188b245ddaf1fe3357 [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 }],
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': {
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:*',
tomhudsonf7edcde2015-03-23 12:51:20 -070088 'utils.gyp:utils',
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',
mtkleincd1f2da2015-07-28 08:55:14 -070097 '../include/private',
bungeman@google.comb8f36552013-07-22 14:39:45 +000098 '../src/core',
bsalomon@google.com9c1f1ac2012-05-07 17:09:37 +000099 '../src/gpu',
robertphillips7b9e8a42014-12-11 08:20:31 -0800100 '../src/image/',
epoger@google.comae85aea2011-05-31 13:50:51 +0000101 ],
102 'sources': [
robertphillips@google.come63296e2013-06-18 14:43:53 +0000103 '<@(skgpu_sources)',
104 '<@(skgpu_native_gl_sources)',
bsalomon7499e692016-02-22 12:13:19 -0800105 '<@(skgpu_vk_sources)',
bsalomon@google.com202a51b2012-09-04 14:37:12 +0000106 'gpu.gypi', # Makes the gypi appear in IDEs (but does not modify the build).
epoger@google.comae85aea2011-05-31 13:50:51 +0000107 ],
epoger@google.comae85aea2011-05-31 13:50:51 +0000108 'conditions': [
egdaniel86e31a12015-03-09 09:40:42 -0700109 [ 'skia_gpu_extra_dependency_path', {
110 'dependencies' : [
111 '<(skia_gpu_extra_dependency_path):*',
egdaniel540e4882015-08-14 08:37:50 -0700112 ],
113 'export_dependent_settings': [
114 '<(skia_gpu_extra_dependency_path):*',
115 ],
egdaniel86e31a12015-03-09 09:40:42 -0700116 }],
robertphillips@google.com42cc2372013-12-10 15:19:32 +0000117 [ 'skia_chrome_utils', {
118 'sources': [
119 '../experimental/ChromeUtils/SkBorder.cpp',
120 '../experimental/ChromeUtils/SkBorder.h',
121 ],
122 'defines': [
123 'GR_CHROME_UTILS=1',
124 ],
125 }],
borenet@google.com05d550e2013-06-11 15:52:19 +0000126 [ 'skia_os == "linux" or skia_os == "chromeos"', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000127 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000128 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
129 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
epoger@google.comae85aea2011-05-31 13:50:51 +0000130 ],
derekf29dda802014-10-01 10:52:52 -0700131 }],
132 [ '(skia_os == "linux" or skia_os == "chromeos") and skia_egl == 1', {
133 'link_settings': {
134 'libraries': [
135 '-lEGL',
136 '-lGLESv2',
137 ],
138 },
139 }],
140 [ '(skia_os == "linux" or skia_os == "chromeos") and skia_egl == 0', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000141 'link_settings': {
142 'libraries': [
143 '-lGL',
borenet@google.com7158e6a2012-11-01 17:43:44 +0000144 '-lGLU',
senorblanco@chromium.org0d923532012-11-12 20:55:02 +0000145 '-lX11',
epoger@google.comae85aea2011-05-31 13:50:51 +0000146 ],
147 },
148 }],
epoger@google.com8846cb22011-07-01 20:20:07 +0000149 [ 'skia_os == "mac"', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000150 'link_settings': {
151 'libraries': [
152 '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
153 ],
154 },
155 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000156 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
157 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
epoger@google.comae85aea2011-05-31 13:50:51 +0000158 ],
bsalomon@google.com373a6632011-10-19 20:43:20 +0000159 }],
bsalomon@google.comcca3c8f2012-09-28 16:56:28 +0000160 [ 'skia_os in ["win", "ios"]', {
epoger@google.comae85aea2011-05-31 13:50:51 +0000161 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000162 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
163 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
epoger@google.comae85aea2011-05-31 13:50:51 +0000164 ],
165 }],
djsollen@google.com58629292011-11-03 13:08:29 +0000166 [ 'skia_os == "android"', {
167 'sources!': [
tomhudson@google.com40725562012-02-10 21:35:06 +0000168 '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
169 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
djsollen@google.com58629292011-11-03 13:08:29 +0000170 ],
Derek Sollenbergerc7d29c82014-07-10 08:10:20 -0400171 'defines': [
172 'GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE=1',
173 ],
djsollen@google.com58629292011-11-03 13:08:29 +0000174 'link_settings': {
175 'libraries': [
176 '-lGLESv2',
177 '-lEGL',
djsollen@google.com58629292011-11-03 13:08:29 +0000178 ],
179 },
180 }],
bsalomon7499e692016-02-22 12:13:19 -0800181 [ 'skia_vulkan', {
bsalomon41dc3d62016-03-04 13:38:26 -0800182 'conditions': [
183 [ 'skia_os == "win"', {
184 'variables': {
185 'vulkan_lib_name': '-lvulkan-1',
bsalomonf98bc6d2016-03-03 16:38:22 -0800186 'vulkan_sdk_path' : '<!(echo %VK_SDK_PATH%)',
bsalomon41dc3d62016-03-04 13:38:26 -0800187 },
188 'include_dirs': [
189 '<(vulkan_sdk_path)/Include',
190 ],
191 'direct_dependent_settings': {
192 'include_dirs': [
193 '<(vulkan_sdk_path)/Include',
194 ],
195 },
196 'link_settings': {
bsalomona6b439a2016-03-10 12:31:20 -0800197 'conditions': [
198 [ 'skia_arch_type == "x86"', {
199 'library_dirs': [ '<(vulkan_sdk_path)/Bin32', ],
200 }, {
201 'library_dirs': [ '<(vulkan_sdk_path)/Bin', ],
202 }],
203 ]
bsalomon41dc3d62016-03-04 13:38:26 -0800204 },
205 }, {
206 'variables': {
207 'vulkan_lib_name': '-lvulkan',
208 },
209 }],
210 ],
bsalomonde7bbab2016-03-03 15:43:03 -0800211 'dependencies': [
212 'shaderc.gyp:shaderc_combined',
213 ],
bsalomon7499e692016-02-22 12:13:19 -0800214 'include_dirs': [
bsalomonde7bbab2016-03-03 15:43:03 -0800215 '../third_party/externals/shaderc2/libshaderc/include',
bsalomon7499e692016-02-22 12:13:19 -0800216 ],
217 'direct_dependent_settings': {
218 'include_dirs': [
bsalomonde7bbab2016-03-03 15:43:03 -0800219 '../third_party/externals/shaderc2/libshaderc/include',
bsalomon7499e692016-02-22 12:13:19 -0800220 ],
221 },
bsalomonf98bc6d2016-03-03 16:38:22 -0800222 'link_settings': {
bsalomon41dc3d62016-03-04 13:38:26 -0800223 'libraries': [ '<(vulkan_lib_name)', ],
bsalomonf98bc6d2016-03-03 16:38:22 -0800224 },
bsalomon7499e692016-02-22 12:13:19 -0800225 }, {
226 'sources!': [
227 '<@(skgpu_vk_sources)',
228 ],
229 }],
epoger@google.comae85aea2011-05-31 13:50:51 +0000230 ],
epoger@google.comae85aea2011-05-31 13:50:51 +0000231 },
232 ],
233}