Home | History | Annotate | Download | only in gyp
      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   },
     78   'targets': [
     79     {
     80       'target_name': 'skgpu',
     81       'product_name': 'skia_skgpu',
     82       'type': 'static_library',
     83       'standalone_static_library': 1,
     84       'dependencies': [
     85         'core.gyp:*',
     86         'utils.gyp:*',
     87         'etc1.gyp:libetc1',
     88         'ktx.gyp:libSkKTX',
     89       ],
     90       'includes': [
     91         'gpu.gypi',
     92       ],
     93       'include_dirs': [
     94         '../include/gpu',
     95         '../src/core',
     96         '../src/gpu',
     97       ],
     98       'sources': [
     99         '<@(skgpu_sources)',
    100         '<@(skgpu_native_gl_sources)',
    101         '<@(skgpu_angle_gl_sources)',
    102         '<@(skgpu_mesa_gl_sources)',
    103         '<@(skgpu_debug_gl_sources)',
    104         '<@(skgpu_null_gl_sources)',
    105         'gpu.gypi', # Makes the gypi appear in IDEs (but does not modify the build).
    106       ],
    107       'conditions': [
    108         [ 'skia_stroke_path_rendering', {
    109           'sources': [
    110             '../experimental/StrokePathRenderer/GrStrokePathRenderer.h',
    111             '../experimental/StrokePathRenderer/GrStrokePathRenderer.cpp',
    112           ],
    113           'defines': [
    114             'GR_STROKE_PATH_RENDERING=1',
    115           ],
    116         }],
    117         [ 'skia_android_path_rendering', {
    118           'sources': [
    119             '../experimental/AndroidPathRenderer/GrAndroidPathRenderer.cpp',
    120             '../experimental/AndroidPathRenderer/GrAndroidPathRenderer.h',
    121             '../experimental/AndroidPathRenderer/AndroidPathRenderer.cpp',
    122             '../experimental/AndroidPathRenderer/AndroidPathRenderer.h',
    123             '../experimental/AndroidPathRenderer/Vertex.h',
    124           ],
    125           'defines': [
    126             'GR_ANDROID_PATH_RENDERING=1',
    127           ],
    128         }],
    129         [ 'skia_chrome_utils', {
    130           'sources': [
    131             '../experimental/ChromeUtils/SkBorder.cpp',
    132             '../experimental/ChromeUtils/SkBorder.h',
    133           ],
    134           'defines': [
    135             'GR_CHROME_UTILS=1',
    136           ],
    137         }],
    138         [ 'skia_os == "linux" or skia_os == "chromeos"', {
    139           'sources!': [
    140             '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
    141             '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
    142           ],
    143           'link_settings': {
    144             'libraries': [
    145               '-lGL',
    146               '-lGLU',
    147               '-lX11',
    148             ],
    149           },
    150         }],
    151         [ 'skia_os == "nacl"', {
    152           'link_settings': {
    153             'libraries': [
    154               '-lppapi_gles2',
    155             ],
    156           },
    157         }],
    158         [ 'skia_mesa and skia_os == "linux"', {
    159           'link_settings': {
    160             'libraries': [
    161               '-lOSMesa',
    162             ],
    163           },
    164         }],
    165         [ 'skia_os == "mac"', {
    166           'link_settings': {
    167             'libraries': [
    168               '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
    169             ],
    170           },
    171           'sources!': [
    172             '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
    173             '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
    174           ],
    175         }],
    176         [ 'not skia_mesa', {
    177           'sources!': [
    178             '../src/gpu/gl/mesa/SkMesaGLContext.cpp',
    179             '../src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp',
    180           ],
    181         }],
    182         [ 'skia_mesa and skia_os == "mac"', {
    183           'link_settings': {
    184             'libraries': [
    185               '/opt/X11/lib/libOSMesa.dylib',
    186             ],
    187           },
    188           'include_dirs': [
    189              '/opt/X11/include/',
    190           ],
    191         }],
    192         [ 'skia_os in ["win", "ios"]', {
    193           'sources!': [
    194             '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
    195             '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
    196           ],
    197         }],
    198         [ 'skia_angle', {
    199           'dependencies': [
    200             'angle.gyp:*',
    201           ],
    202           'export_dependent_settings': [
    203             'angle.gyp:*',
    204           ],
    205         }, { # not skia_angle
    206           'sources!': [
    207             '<@(skgpu_angle_gl_sources)',
    208           ],
    209         }],
    210         [ 'skia_os == "android"', {
    211           'sources!': [
    212             '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
    213             '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
    214           ],
    215           'defines': [
    216             'GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE=1',
    217           ],
    218           'link_settings': {
    219             'libraries': [
    220               '-lGLESv2',
    221               '-lEGL',
    222             ],
    223           },
    224         }],
    225       ],
    226     },
    227   ],
    228 }
    229