scroggo | 3e56227 | 2015-03-25 10:22:41 -0700 | [diff] [blame] | 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. |
commit-bot@chromium.org | 9d0ecf4 | 2014-02-27 20:40:31 +0000 | [diff] [blame] | 5 | # GYP for building gpu |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 6 | { |
bsalomon@google.com | e295313 | 2011-10-13 13:33:08 +0000 | [diff] [blame] | 7 | 'target_defaults': { |
| 8 | 'conditions': [ |
| 9 | ['skia_os != "win"', { |
| 10 | 'sources/': [ ['exclude', '_win.(h|cpp)$'], |
| 11 | ], |
| 12 | }], |
| 13 | ['skia_os != "mac"', { |
bsalomon@google.com | 2b64f84 | 2012-10-02 15:25:12 +0000 | [diff] [blame] | 14 | 'sources/': [ ['exclude', '_mac.(h|cpp|m|mm)$'], |
bsalomon@google.com | e295313 | 2011-10-13 13:33:08 +0000 | [diff] [blame] | 15 | ], |
| 16 | }], |
borenet@google.com | 05d550e | 2013-06-11 15:52:19 +0000 | [diff] [blame] | 17 | ['skia_os != "linux" and skia_os != "chromeos"', { |
derekf | 29dda80 | 2014-10-01 10:52:52 -0700 | [diff] [blame] | 18 | 'sources/': [ ['exclude', '_glx.(h|cpp)$'], |
bsalomon@google.com | e295313 | 2011-10-13 13:33:08 +0000 | [diff] [blame] | 19 | ], |
| 20 | }], |
| 21 | ['skia_os != "ios"', { |
bsalomon@google.com | 2b64f84 | 2012-10-02 15:25:12 +0000 | [diff] [blame] | 22 | 'sources/': [ ['exclude', '_iOS.(h|cpp|m|mm)$'], |
bsalomon@google.com | e295313 | 2011-10-13 13:33:08 +0000 | [diff] [blame] | 23 | ], |
| 24 | }], |
| 25 | ['skia_os != "android"', { |
| 26 | 'sources/': [ ['exclude', '_android.(h|cpp)$'], |
| 27 | ], |
| 28 | }], |
borenet | 4808757 | 2015-04-02 12:16:36 -0700 | [diff] [blame] | 29 | ['skia_egl == 0', { |
derekf | 29dda80 | 2014-10-01 10:52:52 -0700 | [diff] [blame] | 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 | }], |
bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 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 | }], |
bsalomon@google.com | e295313 | 2011-10-13 13:33:08 +0000 | [diff] [blame] | 66 | ], |
| 67 | 'direct_dependent_settings': { |
| 68 | 'conditions': [ |
bsalomon@google.com | e295313 | 2011-10-13 13:33:08 +0000 | [diff] [blame] | 69 | [ 'skia_os == "win"', { |
| 70 | 'defines': [ |
bsalomon@google.com | e295313 | 2011-10-13 13:33:08 +0000 | [diff] [blame] | 71 | 'GR_GL_FUNCTION_TYPE=__stdcall', |
| 72 | ], |
| 73 | }], |
| 74 | ], |
| 75 | 'include_dirs': [ |
| 76 | '../include/gpu', |
| 77 | ], |
| 78 | }, |
| 79 | }, |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 80 | 'targets': [ |
| 81 | { |
robertphillips@google.com | e63296e | 2013-06-18 14:43:53 +0000 | [diff] [blame] | 82 | 'target_name': 'skgpu', |
| 83 | 'product_name': 'skia_skgpu', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 84 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 85 | 'standalone_static_library': 1, |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 86 | 'dependencies': [ |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 87 | 'core.gyp:*', |
tomhudson | f7edcde | 2015-03-23 12:51:20 -0700 | [diff] [blame] | 88 | 'utils.gyp:utils', |
krajcevski | 9c0e629 | 2014-06-02 07:38:14 -0700 | [diff] [blame] | 89 | 'etc1.gyp:libetc1', |
krajcevski | 99ffe24 | 2014-06-03 13:04:35 -0700 | [diff] [blame] | 90 | 'ktx.gyp:libSkKTX', |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 91 | ], |
bsalomon@google.com | 2080635 | 2012-08-23 12:55:01 +0000 | [diff] [blame] | 92 | 'includes': [ |
| 93 | 'gpu.gypi', |
| 94 | ], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 95 | 'include_dirs': [ |
bungeman@google.com | 899f1d8 | 2013-07-20 00:24:35 +0000 | [diff] [blame] | 96 | '../include/gpu', |
mtklein | cd1f2da | 2015-07-28 08:55:14 -0700 | [diff] [blame] | 97 | '../include/private', |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 98 | '../src/core', |
bsalomon@google.com | 9c1f1ac | 2012-05-07 17:09:37 +0000 | [diff] [blame] | 99 | '../src/gpu', |
robertphillips | 7b9e8a4 | 2014-12-11 08:20:31 -0800 | [diff] [blame] | 100 | '../src/image/', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 101 | ], |
| 102 | 'sources': [ |
robertphillips@google.com | e63296e | 2013-06-18 14:43:53 +0000 | [diff] [blame] | 103 | '<@(skgpu_sources)', |
| 104 | '<@(skgpu_native_gl_sources)', |
| 105 | '<@(skgpu_angle_gl_sources)', |
hendrikw | 885bf09 | 2015-08-27 10:38:39 -0700 | [diff] [blame] | 106 | '<@(skgpu_command_buffer_gl_sources)', |
robertphillips@google.com | e63296e | 2013-06-18 14:43:53 +0000 | [diff] [blame] | 107 | '<@(skgpu_mesa_gl_sources)', |
| 108 | '<@(skgpu_debug_gl_sources)', |
| 109 | '<@(skgpu_null_gl_sources)', |
bsalomon | 7499e69 | 2016-02-22 12:13:19 -0800 | [diff] [blame] | 110 | '<@(skgpu_vk_sources)', |
bsalomon@google.com | 202a51b | 2012-09-04 14:37:12 +0000 | [diff] [blame] | 111 | 'gpu.gypi', # Makes the gypi appear in IDEs (but does not modify the build). |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 112 | ], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 113 | 'conditions': [ |
egdaniel | 86e31a1 | 2015-03-09 09:40:42 -0700 | [diff] [blame] | 114 | [ 'skia_gpu_extra_dependency_path', { |
| 115 | 'dependencies' : [ |
| 116 | '<(skia_gpu_extra_dependency_path):*', |
egdaniel | 540e488 | 2015-08-14 08:37:50 -0700 | [diff] [blame] | 117 | ], |
| 118 | 'export_dependent_settings': [ |
| 119 | '<(skia_gpu_extra_dependency_path):*', |
| 120 | ], |
egdaniel | 86e31a1 | 2015-03-09 09:40:42 -0700 | [diff] [blame] | 121 | }], |
robertphillips@google.com | 42cc237 | 2013-12-10 15:19:32 +0000 | [diff] [blame] | 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 | }], |
borenet@google.com | 05d550e | 2013-06-11 15:52:19 +0000 | [diff] [blame] | 131 | [ 'skia_os == "linux" or skia_os == "chromeos"', { |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 132 | 'sources!': [ |
tomhudson@google.com | 4072556 | 2012-02-10 21:35:06 +0000 | [diff] [blame] | 133 | '../src/gpu/gl/GrGLDefaultInterface_none.cpp', |
| 134 | '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 135 | ], |
derekf | 29dda80 | 2014-10-01 10:52:52 -0700 | [diff] [blame] | 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', { |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 146 | 'link_settings': { |
| 147 | 'libraries': [ |
| 148 | '-lGL', |
borenet@google.com | 7158e6a | 2012-11-01 17:43:44 +0000 | [diff] [blame] | 149 | '-lGLU', |
senorblanco@chromium.org | 0d92353 | 2012-11-12 20:55:02 +0000 | [diff] [blame] | 150 | '-lX11', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 151 | ], |
| 152 | }, |
| 153 | }], |
derekf | 29dda80 | 2014-10-01 10:52:52 -0700 | [diff] [blame] | 154 | [ 'skia_egl == 1', { |
| 155 | 'defines': [ |
| 156 | 'SK_EGL=1', |
| 157 | ], |
| 158 | }], |
| 159 | [ 'skia_egl == 0', { |
| 160 | 'defines': [ |
| 161 | 'SK_EGL=0', |
| 162 | ], |
| 163 | }], |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 164 | [ 'skia_mesa and skia_os == "linux"', { |
| 165 | 'link_settings': { |
| 166 | 'libraries': [ |
| 167 | '-lOSMesa', |
| 168 | ], |
| 169 | }, |
| 170 | }], |
epoger@google.com | 8846cb2 | 2011-07-01 20:20:07 +0000 | [diff] [blame] | 171 | [ 'skia_os == "mac"', { |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 172 | 'link_settings': { |
| 173 | 'libraries': [ |
| 174 | '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework', |
| 175 | ], |
| 176 | }, |
| 177 | 'sources!': [ |
tomhudson@google.com | 4072556 | 2012-02-10 21:35:06 +0000 | [diff] [blame] | 178 | '../src/gpu/gl/GrGLDefaultInterface_none.cpp', |
| 179 | '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 180 | ], |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 181 | }], |
robertphillips@google.com | e63296e | 2013-06-18 14:43:53 +0000 | [diff] [blame] | 182 | [ 'not skia_mesa', { |
| 183 | 'sources!': [ |
| 184 | '../src/gpu/gl/mesa/SkMesaGLContext.cpp', |
| 185 | '../src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp', |
| 186 | ], |
| 187 | }], |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 188 | [ 'skia_mesa and skia_os == "mac"', { |
| 189 | 'link_settings': { |
| 190 | 'libraries': [ |
bsalomon@google.com | 71cf3ae | 2013-02-04 22:17:13 +0000 | [diff] [blame] | 191 | '/opt/X11/lib/libOSMesa.dylib', |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 192 | ], |
| 193 | }, |
| 194 | 'include_dirs': [ |
bsalomon@google.com | 71cf3ae | 2013-02-04 22:17:13 +0000 | [diff] [blame] | 195 | '/opt/X11/include/', |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 196 | ], |
| 197 | }], |
bsalomon@google.com | cca3c8f | 2012-09-28 16:56:28 +0000 | [diff] [blame] | 198 | [ 'skia_os in ["win", "ios"]', { |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 199 | 'sources!': [ |
tomhudson@google.com | 4072556 | 2012-02-10 21:35:06 +0000 | [diff] [blame] | 200 | '../src/gpu/gl/GrGLDefaultInterface_none.cpp', |
| 201 | '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 202 | ], |
| 203 | }], |
commit-bot@chromium.org | 9d0ecf4 | 2014-02-27 20:40:31 +0000 | [diff] [blame] | 204 | [ 'skia_angle', { |
| 205 | 'dependencies': [ |
| 206 | 'angle.gyp:*', |
| 207 | ], |
| 208 | 'export_dependent_settings': [ |
| 209 | 'angle.gyp:*', |
| 210 | ], |
| 211 | }, { # not skia_angle |
robertphillips@google.com | 021bce9 | 2012-04-02 20:42:26 +0000 | [diff] [blame] | 212 | 'sources!': [ |
robertphillips@google.com | e63296e | 2013-06-18 14:43:53 +0000 | [diff] [blame] | 213 | '<@(skgpu_angle_gl_sources)', |
djsollen@google.com | 403b90e | 2013-05-03 14:00:34 +0000 | [diff] [blame] | 214 | ], |
robertphillips@google.com | 021bce9 | 2012-04-02 20:42:26 +0000 | [diff] [blame] | 215 | }], |
hendrikw | 885bf09 | 2015-08-27 10:38:39 -0700 | [diff] [blame] | 216 | [ 'skia_command_buffer', { |
| 217 | }, { # not skia_command_buffer |
| 218 | 'sources!': [ |
| 219 | '<@(skgpu_command_buffer_gl_sources)', |
| 220 | ], |
| 221 | }], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 222 | [ 'skia_os == "android"', { |
| 223 | 'sources!': [ |
tomhudson@google.com | 4072556 | 2012-02-10 21:35:06 +0000 | [diff] [blame] | 224 | '../src/gpu/gl/GrGLDefaultInterface_none.cpp', |
| 225 | '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 226 | ], |
Derek Sollenberger | c7d29c8 | 2014-07-10 08:10:20 -0400 | [diff] [blame] | 227 | 'defines': [ |
| 228 | 'GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE=1', |
| 229 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 230 | 'link_settings': { |
| 231 | 'libraries': [ |
| 232 | '-lGLESv2', |
| 233 | '-lEGL', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 234 | ], |
| 235 | }, |
| 236 | }], |
bsalomon | 7499e69 | 2016-02-22 12:13:19 -0800 | [diff] [blame] | 237 | [ 'skia_vulkan', { |
bsalomon | f98bc6d | 2016-03-03 16:38:22 -0800 | [diff] [blame^] | 238 | 'variables': { |
| 239 | 'conditions': [ |
| 240 | [ 'skia_os == "win"', { |
| 241 | 'vulkan_sdk_path' : '<!(echo %VK_SDK_PATH%)', |
| 242 | }, { |
| 243 | 'vulkan_sdk_path' : '<!(echo $VK_SDK_PATH)', |
| 244 | }], |
| 245 | ], |
| 246 | }, |
bsalomon | de7bbab | 2016-03-03 15:43:03 -0800 | [diff] [blame] | 247 | 'dependencies': [ |
| 248 | 'shaderc.gyp:shaderc_combined', |
| 249 | ], |
bsalomon | 7499e69 | 2016-02-22 12:13:19 -0800 | [diff] [blame] | 250 | 'include_dirs': [ |
bsalomon | de7bbab | 2016-03-03 15:43:03 -0800 | [diff] [blame] | 251 | '../third_party/', # To include files under third_party/vulkan |
| 252 | '../third_party/externals/shaderc2/libshaderc/include', |
bsalomon | f98bc6d | 2016-03-03 16:38:22 -0800 | [diff] [blame^] | 253 | '<(vulkan_sdk_path)/Include', |
bsalomon | 7499e69 | 2016-02-22 12:13:19 -0800 | [diff] [blame] | 254 | ], |
| 255 | 'direct_dependent_settings': { |
| 256 | 'include_dirs': [ |
bsalomon | de7bbab | 2016-03-03 15:43:03 -0800 | [diff] [blame] | 257 | '../third_party/', # To include files under third_party/vulkan |
| 258 | '../third_party/externals/shaderc2/libshaderc/include', |
bsalomon | f98bc6d | 2016-03-03 16:38:22 -0800 | [diff] [blame^] | 259 | '<(vulkan_sdk_path)/Include', |
bsalomon | 7499e69 | 2016-02-22 12:13:19 -0800 | [diff] [blame] | 260 | ], |
| 261 | }, |
bsalomon | f98bc6d | 2016-03-03 16:38:22 -0800 | [diff] [blame^] | 262 | 'link_settings': { |
| 263 | 'library_dirs': [ '<(vulkan_sdk_path)/Bin', ], |
| 264 | 'libraries': [ '-lvulkan-1', ], |
| 265 | }, |
bsalomon | 7499e69 | 2016-02-22 12:13:19 -0800 | [diff] [blame] | 266 | }, { |
| 267 | 'sources!': [ |
| 268 | '<@(skgpu_vk_sources)', |
| 269 | ], |
| 270 | }], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 271 | ], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 272 | }, |
| 273 | ], |
| 274 | } |