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 | 43bf511 | 2016-04-29 14:01:34 -0700 | [diff] [blame] | 17 | ['skia_os != "linux"', { |
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': { |
bsalomon@google.com | e295313 | 2011-10-13 13:33:08 +0000 | [diff] [blame] | 68 | 'include_dirs': [ |
| 69 | '../include/gpu', |
| 70 | ], |
| 71 | }, |
| 72 | }, |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 73 | 'targets': [ |
| 74 | { |
robertphillips@google.com | e63296e | 2013-06-18 14:43:53 +0000 | [diff] [blame] | 75 | 'target_name': 'skgpu', |
| 76 | 'product_name': 'skia_skgpu', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 77 | 'type': 'static_library', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 78 | 'standalone_static_library': 1, |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 79 | 'dependencies': [ |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 80 | 'core.gyp:*', |
tomhudson | f7edcde | 2015-03-23 12:51:20 -0700 | [diff] [blame] | 81 | 'utils.gyp:utils', |
krajcevski | 9c0e629 | 2014-06-02 07:38:14 -0700 | [diff] [blame] | 82 | 'etc1.gyp:libetc1', |
krajcevski | 99ffe24 | 2014-06-03 13:04:35 -0700 | [diff] [blame] | 83 | 'ktx.gyp:libSkKTX', |
ethannicholas | b3058bd | 2016-07-01 08:22:01 -0700 | [diff] [blame] | 84 | 'sksl.gyp:sksl', |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 85 | ], |
bsalomon@google.com | 2080635 | 2012-08-23 12:55:01 +0000 | [diff] [blame] | 86 | 'includes': [ |
| 87 | 'gpu.gypi', |
| 88 | ], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 89 | 'include_dirs': [ |
bungeman@google.com | 899f1d8 | 2013-07-20 00:24:35 +0000 | [diff] [blame] | 90 | '../include/gpu', |
mtklein | cd1f2da | 2015-07-28 08:55:14 -0700 | [diff] [blame] | 91 | '../include/private', |
bungeman@google.com | b8f3655 | 2013-07-22 14:39:45 +0000 | [diff] [blame] | 92 | '../src/core', |
bsalomon@google.com | 9c1f1ac | 2012-05-07 17:09:37 +0000 | [diff] [blame] | 93 | '../src/gpu', |
robertphillips | 7b9e8a4 | 2014-12-11 08:20:31 -0800 | [diff] [blame] | 94 | '../src/image/', |
ethannicholas | b3058bd | 2016-07-01 08:22:01 -0700 | [diff] [blame] | 95 | '../src/sksl', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 96 | ], |
| 97 | 'sources': [ |
robertphillips@google.com | e63296e | 2013-06-18 14:43:53 +0000 | [diff] [blame] | 98 | '<@(skgpu_sources)', |
| 99 | '<@(skgpu_native_gl_sources)', |
bsalomon | 7499e69 | 2016-02-22 12:13:19 -0800 | [diff] [blame] | 100 | '<@(skgpu_vk_sources)', |
bsalomon@google.com | 202a51b | 2012-09-04 14:37:12 +0000 | [diff] [blame] | 101 | '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] | 102 | ], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 103 | 'conditions': [ |
egdaniel | 86e31a1 | 2015-03-09 09:40:42 -0700 | [diff] [blame] | 104 | [ 'skia_gpu_extra_dependency_path', { |
| 105 | 'dependencies' : [ |
| 106 | '<(skia_gpu_extra_dependency_path):*', |
egdaniel | 540e488 | 2015-08-14 08:37:50 -0700 | [diff] [blame] | 107 | ], |
| 108 | 'export_dependent_settings': [ |
| 109 | '<(skia_gpu_extra_dependency_path):*', |
| 110 | ], |
egdaniel | 86e31a1 | 2015-03-09 09:40:42 -0700 | [diff] [blame] | 111 | }], |
robertphillips@google.com | 42cc237 | 2013-12-10 15:19:32 +0000 | [diff] [blame] | 112 | [ '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 | }], |
borenet | 43bf511 | 2016-04-29 14:01:34 -0700 | [diff] [blame] | 121 | [ 'skia_os == "linux"', { |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 122 | 'sources!': [ |
tomhudson@google.com | 4072556 | 2012-02-10 21:35:06 +0000 | [diff] [blame] | 123 | '../src/gpu/gl/GrGLDefaultInterface_none.cpp', |
| 124 | '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 125 | ], |
derekf | 29dda80 | 2014-10-01 10:52:52 -0700 | [diff] [blame] | 126 | }], |
borenet | 43bf511 | 2016-04-29 14:01:34 -0700 | [diff] [blame] | 127 | [ 'skia_os == "linux" and skia_egl == 1', { |
derekf | 29dda80 | 2014-10-01 10:52:52 -0700 | [diff] [blame] | 128 | 'link_settings': { |
| 129 | 'libraries': [ |
| 130 | '-lEGL', |
| 131 | '-lGLESv2', |
| 132 | ], |
| 133 | }, |
| 134 | }], |
borenet | 43bf511 | 2016-04-29 14:01:34 -0700 | [diff] [blame] | 135 | [ 'skia_os == "linux" and skia_egl == 0', { |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 136 | 'link_settings': { |
| 137 | 'libraries': [ |
| 138 | '-lGL', |
borenet@google.com | 7158e6a | 2012-11-01 17:43:44 +0000 | [diff] [blame] | 139 | '-lGLU', |
senorblanco@chromium.org | 0d92353 | 2012-11-12 20:55:02 +0000 | [diff] [blame] | 140 | '-lX11', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 141 | ], |
| 142 | }, |
| 143 | }], |
epoger@google.com | 8846cb2 | 2011-07-01 20:20:07 +0000 | [diff] [blame] | 144 | [ 'skia_os == "mac"', { |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 145 | 'link_settings': { |
| 146 | 'libraries': [ |
| 147 | '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework', |
| 148 | ], |
| 149 | }, |
| 150 | 'sources!': [ |
tomhudson@google.com | 4072556 | 2012-02-10 21:35:06 +0000 | [diff] [blame] | 151 | '../src/gpu/gl/GrGLDefaultInterface_none.cpp', |
| 152 | '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 153 | ], |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 154 | }], |
bsalomon@google.com | cca3c8f | 2012-09-28 16:56:28 +0000 | [diff] [blame] | 155 | [ 'skia_os in ["win", "ios"]', { |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 156 | 'sources!': [ |
tomhudson@google.com | 4072556 | 2012-02-10 21:35:06 +0000 | [diff] [blame] | 157 | '../src/gpu/gl/GrGLDefaultInterface_none.cpp', |
| 158 | '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp', |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 159 | ], |
| 160 | }], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 161 | [ 'skia_os == "android"', { |
| 162 | 'sources!': [ |
tomhudson@google.com | 4072556 | 2012-02-10 21:35:06 +0000 | [diff] [blame] | 163 | '../src/gpu/gl/GrGLDefaultInterface_none.cpp', |
| 164 | '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 165 | ], |
Derek Sollenberger | c7d29c8 | 2014-07-10 08:10:20 -0400 | [diff] [blame] | 166 | 'defines': [ |
| 167 | 'GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE=1', |
| 168 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 169 | 'link_settings': { |
| 170 | 'libraries': [ |
| 171 | '-lGLESv2', |
| 172 | '-lEGL', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 173 | ], |
| 174 | }, |
| 175 | }], |
bsalomon | 7499e69 | 2016-02-22 12:13:19 -0800 | [diff] [blame] | 176 | [ 'skia_vulkan', { |
djsollen | d5fd2ff | 2016-07-06 09:17:35 -0700 | [diff] [blame] | 177 | 'link_settings': { |
| 178 | 'libraries': [ '<(vulkan_lib_name)', ], |
| 179 | }, |
| 180 | 'dependencies': [ |
| 181 | 'shaderc.gyp:shaderc_combined', |
| 182 | ], |
bsalomon | 41dc3d6 | 2016-03-04 13:38:26 -0800 | [diff] [blame] | 183 | 'conditions': [ |
| 184 | [ 'skia_os == "win"', { |
| 185 | 'variables': { |
| 186 | 'vulkan_lib_name': '-lvulkan-1', |
bsalomon | f98bc6d | 2016-03-03 16:38:22 -0800 | [diff] [blame] | 187 | 'vulkan_sdk_path' : '<!(echo %VK_SDK_PATH%)', |
bsalomon | 41dc3d6 | 2016-03-04 13:38:26 -0800 | [diff] [blame] | 188 | }, |
| 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': { |
bsalomon | a6b439a | 2016-03-10 12:31:20 -0800 | [diff] [blame] | 198 | 'conditions': [ |
| 199 | [ 'skia_arch_type == "x86"', { |
| 200 | 'library_dirs': [ '<(vulkan_sdk_path)/Bin32', ], |
| 201 | }, { |
| 202 | 'library_dirs': [ '<(vulkan_sdk_path)/Bin', ], |
| 203 | }], |
| 204 | ] |
bsalomon | 41dc3d6 | 2016-03-04 13:38:26 -0800 | [diff] [blame] | 205 | }, |
| 206 | }, { |
| 207 | 'variables': { |
| 208 | 'vulkan_lib_name': '-lvulkan', |
| 209 | }, |
| 210 | }], |
egdaniel | 58daedb | 2016-06-17 12:04:05 -0700 | [diff] [blame] | 211 | [ '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 | }], |
djsollen | d5fd2ff | 2016-07-06 09:17:35 -0700 | [diff] [blame] | 227 | [ '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. |
mtklein | 3d96cb8 | 2016-08-10 07:30:21 -0700 | [diff] [blame] | 247 | '<(skia_src_path)/../tools/viewer/sk_app/WindowContext.cpp', |
djsollen | d5fd2ff | 2016-07-06 09:17:35 -0700 | [diff] [blame] | 248 | '<(skia_src_path)/../tools/viewer/sk_app/VulkanWindowContext.cpp', |
| 249 | '<(skia_src_path)/../tools/viewer/sk_app/android/VulkanWindowContext_android.cpp' |
| 250 | ], |
| 251 | }], |
bsalomon | 41dc3d6 | 2016-03-04 13:38:26 -0800 | [diff] [blame] | 252 | ], |
bsalomon | 7499e69 | 2016-02-22 12:13:19 -0800 | [diff] [blame] | 253 | }, { |
| 254 | 'sources!': [ |
| 255 | '<@(skgpu_vk_sources)', |
| 256 | ], |
| 257 | }], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 258 | ], |
epoger@google.com | ae85aea | 2011-05-31 13:50:51 +0000 | [diff] [blame] | 259 | }, |
| 260 | ], |
| 261 | } |