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