1 # GYP for building gpu 2 { 3 'target_defaults': { 4 'conditions': [ 5 ['skia_os != "win"', { 6 'sources/': [ ['exclude', '_win.(h|cpp)$'], 7 ], 8 }], 9 ['skia_os != "mac"', { 10 'sources/': [ ['exclude', '_mac.(h|cpp|m|mm)$'], 11 ], 12 }], 13 ['skia_os != "linux" and skia_os != "chromeos"', { 14 'sources/': [ ['exclude', '_unix.(h|cpp)$'], 15 ], 16 }], 17 ['skia_os != "ios"', { 18 'sources/': [ ['exclude', '_iOS.(h|cpp|m|mm)$'], 19 ], 20 }], 21 ['skia_os != "android"', { 22 'sources/': [ ['exclude', '_android.(h|cpp)$'], 23 ], 24 }], 25 ['skia_os != "nacl"', { 26 'sources/': [ ['exclude', '_nacl.(h|cpp)$'], 27 ], 28 }], 29 # nullify the targets in this gyp file if skia_gpu is 0 30 [ 'skia_gpu == 0', { 31 'sources/': [ 32 ['exclude', '.*'], 33 ], 34 'defines/': [ 35 ['exclude', '.*'], 36 ], 37 'include_dirs/': [ 38 ['exclude', '.*'], 39 ], 40 'link_settings': { 41 'libraries/': [ 42 ['exclude', '.*'], 43 ], 44 }, 45 'direct_dependent_settings': { 46 'defines/': [ 47 ['exclude', '.*'], 48 ], 49 'include_dirs/': [ 50 ['exclude', '.*'], 51 ], 52 }, 53 }], 54 [ 'skia_resource_cache_mb_limit != 0', { 55 'defines': [ 56 'GR_DEFAULT_RESOURCE_CACHE_MB_LIMIT=<(skia_resource_cache_mb_limit)', 57 ], 58 }], 59 [ 'skia_resource_cache_count_limit != 0', { 60 'defines': [ 61 'GR_DEFAULT_RESOURCE_CACHE_COUNT_LIMIT=<(skia_resource_cache_count_limit)', 62 ], 63 }], 64 ], 65 'direct_dependent_settings': { 66 'conditions': [ 67 [ 'skia_os == "win"', { 68 'defines': [ 69 'GR_GL_FUNCTION_TYPE=__stdcall', 70 ], 71 }], 72 ], 73 'include_dirs': [ 74 '../include/gpu', 75 ], 76 }, 77 'defines': [ 78 'GR_COMPRESS_ALPHA_MASK=0', 79 ], 80 }, 81 'targets': [ 82 { 83 'target_name': 'skgpu', 84 'product_name': 'skia_skgpu', 85 'type': 'static_library', 86 'standalone_static_library': 1, 87 'dependencies': [ 88 'core.gyp:*', 89 'utils.gyp:*', 90 'etc1.gyp:libetc1', 91 'ktx.gyp:libSkKTX', 92 ], 93 'includes': [ 94 'gpu.gypi', 95 ], 96 'include_dirs': [ 97 '../include/gpu', 98 '../src/core', 99 '../src/gpu', 100 ], 101 'sources': [ 102 '<@(skgpu_sources)', 103 '<@(skgpu_native_gl_sources)', 104 '<@(skgpu_angle_gl_sources)', 105 '<@(skgpu_mesa_gl_sources)', 106 '<@(skgpu_debug_gl_sources)', 107 '<@(skgpu_null_gl_sources)', 108 'gpu.gypi', # Makes the gypi appear in IDEs (but does not modify the build). 109 ], 110 'conditions': [ 111 [ 'skia_stroke_path_rendering', { 112 'sources': [ 113 '../experimental/StrokePathRenderer/GrStrokePathRenderer.h', 114 '../experimental/StrokePathRenderer/GrStrokePathRenderer.cpp', 115 ], 116 'defines': [ 117 'GR_STROKE_PATH_RENDERING=1', 118 ], 119 }], 120 [ 'skia_android_path_rendering', { 121 'sources': [ 122 '../experimental/AndroidPathRenderer/GrAndroidPathRenderer.cpp', 123 '../experimental/AndroidPathRenderer/GrAndroidPathRenderer.h', 124 '../experimental/AndroidPathRenderer/AndroidPathRenderer.cpp', 125 '../experimental/AndroidPathRenderer/AndroidPathRenderer.h', 126 '../experimental/AndroidPathRenderer/Vertex.h', 127 ], 128 'defines': [ 129 'GR_ANDROID_PATH_RENDERING=1', 130 ], 131 }], 132 [ 'skia_chrome_utils', { 133 'sources': [ 134 '../experimental/ChromeUtils/SkBorder.cpp', 135 '../experimental/ChromeUtils/SkBorder.h', 136 ], 137 'defines': [ 138 'GR_CHROME_UTILS=1', 139 ], 140 }], 141 [ 'skia_os == "linux" or skia_os == "chromeos"', { 142 'sources!': [ 143 '../src/gpu/gl/GrGLDefaultInterface_none.cpp', 144 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp', 145 ], 146 'link_settings': { 147 'libraries': [ 148 '-lGL', 149 '-lGLU', 150 '-lX11', 151 ], 152 }, 153 }], 154 [ 'skia_os == "nacl"', { 155 'link_settings': { 156 'libraries': [ 157 '-lppapi_gles2', 158 ], 159 }, 160 }], 161 [ 'skia_mesa and skia_os == "linux"', { 162 'link_settings': { 163 'libraries': [ 164 '-lOSMesa', 165 ], 166 }, 167 }], 168 [ 'skia_os == "mac"', { 169 'link_settings': { 170 'libraries': [ 171 '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework', 172 ], 173 }, 174 'sources!': [ 175 '../src/gpu/gl/GrGLDefaultInterface_none.cpp', 176 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp', 177 ], 178 }], 179 [ 'not skia_mesa', { 180 'sources!': [ 181 '../src/gpu/gl/mesa/SkMesaGLContext.cpp', 182 '../src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp', 183 ], 184 }], 185 [ 'skia_mesa and skia_os == "mac"', { 186 'link_settings': { 187 'libraries': [ 188 '/opt/X11/lib/libOSMesa.dylib', 189 ], 190 }, 191 'include_dirs': [ 192 '/opt/X11/include/', 193 ], 194 }], 195 [ 'skia_os in ["win", "ios"]', { 196 'sources!': [ 197 '../src/gpu/gl/GrGLDefaultInterface_none.cpp', 198 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp', 199 ], 200 }], 201 [ 'skia_angle', { 202 'dependencies': [ 203 'angle.gyp:*', 204 ], 205 'export_dependent_settings': [ 206 'angle.gyp:*', 207 ], 208 }, { # not skia_angle 209 'sources!': [ 210 '<@(skgpu_angle_gl_sources)', 211 ], 212 }], 213 [ 'skia_os == "android"', { 214 'sources!': [ 215 '../src/gpu/gl/GrGLDefaultInterface_none.cpp', 216 '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp', 217 ], 218 'link_settings': { 219 'libraries': [ 220 '-lGLESv2', 221 '-lEGL', 222 ], 223 }, 224 }], 225 ], 226 }, 227 ], 228 } 229