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       [ 'skia_os == "android"', {
     29         'defines': [
     30           'GR_ANDROID_BUILD=1',
     31         ],
     32       }],
     33       [ 'skia_os == "mac"', {
     34         'defines': [
     35           'GR_MAC_BUILD=1',
     36         ],
     37       }],
     38       [ 'skia_os == "linux" or skia_os == "chromeos"', {
     39         'defines': [
     40           'GR_LINUX_BUILD=1',
     41         ],
     42       }],
     43       [ 'skia_os == "ios"', {
     44         'defines': [
     45           'GR_IOS_BUILD=1',
     46         ],
     47       }],
     48       [ 'skia_os == "win"', {
     49         'defines': [
     50           'GR_WIN32_BUILD=1',
     51         ],
     52       }],
     53       # nullify the targets in this gyp file if skia_gpu is 0
     54       [ 'skia_gpu == 0', {
     55         'sources/': [
     56           ['exclude', '.*'],
     57         ],
     58         'defines/': [
     59           ['exclude', '.*'],
     60         ],
     61         'include_dirs/': [
     62            ['exclude', '.*'],
     63         ],
     64         'link_settings': {
     65           'libraries/': [
     66             ['exclude', '.*'],
     67           ],
     68         },
     69         'direct_dependent_settings': {
     70           'defines/': [
     71             ['exclude', '.*'],
     72           ],
     73           'include_dirs/': [
     74             ['exclude', '.*'],
     75           ],
     76         },
     77       }],
     78       [ 'skia_texture_cache_mb_limit != 0', {
     79         'defines': [
     80           'GR_DEFAULT_TEXTURE_CACHE_MB_LIMIT=<(skia_texture_cache_mb_limit)',
     81         ],
     82       }],
     83     ],
     84     'direct_dependent_settings': {
     85       'conditions': [
     86         [ 'skia_os == "android"', {
     87           'defines': [
     88             'GR_ANDROID_BUILD=1',
     89           ],
     90         }],
     91         [ 'skia_os == "mac"', {
     92           'defines': [
     93             'GR_MAC_BUILD=1',
     94           ],
     95         }],
     96         [ 'skia_os == "linux"', {
     97           'defines': [
     98             'GR_LINUX_BUILD=1',
     99           ],
    100         }],
    101         [ 'skia_os == "ios"', {
    102           'defines': [
    103             'GR_IOS_BUILD=1',
    104           ],
    105         }],
    106         [ 'skia_os == "win"', {
    107           'defines': [
    108             'GR_WIN32_BUILD=1',
    109             'GR_GL_FUNCTION_TYPE=__stdcall',
    110           ],
    111         }],
    112       ],
    113       'include_dirs': [
    114         '../include/gpu',
    115       ],
    116     },
    117   },
    118   'targets': [
    119     {
    120       'target_name': 'skgpu',
    121       'product_name': 'skia_skgpu',
    122       'type': 'static_library',
    123       'standalone_static_library': 1,
    124       'dependencies': [
    125         'angle.gyp:*',
    126         'core.gyp:*',
    127         'utils.gyp:*',
    128       ],
    129       'includes': [
    130         'gpu.gypi',
    131       ],
    132       'include_dirs': [
    133         '../include/gpu',
    134         '../src/core',
    135         '../src/gpu',
    136       ],
    137       'export_dependent_settings': [
    138         'angle.gyp:*',
    139       ],
    140       'sources': [
    141         '<@(skgpu_sources)',
    142         '<@(skgpu_native_gl_sources)',
    143         '<@(skgpu_angle_gl_sources)',
    144         '<@(skgpu_mesa_gl_sources)',
    145         '<@(skgpu_debug_gl_sources)',
    146         '<@(skgpu_null_gl_sources)',
    147         'gpu.gypi', # Makes the gypi appear in IDEs (but does not modify the build).
    148       ],
    149       'defines': [
    150         'GR_IMPLEMENTATION=1',
    151       ],
    152       'conditions': [
    153         [ 'skia_nv_path_rendering', {
    154           'defines': [
    155             'GR_GL_USE_NV_PATH_RENDERING=1',
    156           ],
    157         }],
    158         [ 'skia_stroke_path_rendering', {
    159           'sources': [
    160             '../experimental/StrokePathRenderer/GrStrokePathRenderer.h',
    161             '../experimental/StrokePathRenderer/GrStrokePathRenderer.cpp',
    162           ],
    163           'defines': [
    164             'GR_STROKE_PATH_RENDERING=1',
    165           ],
    166         }],
    167         [ 'skia_android_path_rendering', {
    168           'sources': [
    169             '../experimental/AndroidPathRenderer/GrAndroidPathRenderer.cpp',
    170             '../experimental/AndroidPathRenderer/GrAndroidPathRenderer.h',
    171             '../experimental/AndroidPathRenderer/AndroidPathRenderer.cpp',
    172             '../experimental/AndroidPathRenderer/AndroidPathRenderer.h',
    173             '../experimental/AndroidPathRenderer/Vertex.h',
    174           ],
    175           'defines': [
    176             'GR_ANDROID_PATH_RENDERING=1',
    177           ],
    178         }],
    179         [ 'skia_os == "linux" or skia_os == "chromeos"', {
    180           'sources!': [
    181             '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
    182             '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
    183           ],
    184           'link_settings': {
    185             'libraries': [
    186               '-lGL',
    187               '-lGLU',
    188               '-lX11',
    189             ],
    190           },
    191         }],
    192         [ 'skia_os == "nacl"', {
    193           'link_settings': {
    194             'libraries': [
    195               '-lppapi_gles2',
    196             ],
    197           },
    198         }],
    199         [ 'skia_mesa and skia_os == "linux"', {
    200           'link_settings': {
    201             'libraries': [
    202               '-lOSMesa',
    203             ],
    204           },
    205         }],
    206         [ 'skia_os == "mac"', {
    207           'link_settings': {
    208             'libraries': [
    209               '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
    210             ],
    211           },
    212           'sources!': [
    213             '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
    214             '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
    215           ],
    216         }],
    217         [ 'not skia_mesa', {
    218           'sources!': [
    219             '../src/gpu/gl/mesa/SkMesaGLContext.cpp',
    220             '../src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp',
    221           ],
    222         }],
    223         [ 'skia_mesa and skia_os == "mac"', {
    224           'link_settings': {
    225             'libraries': [
    226               '/opt/X11/lib/libOSMesa.dylib',
    227             ],
    228           },
    229           'include_dirs': [
    230              '/opt/X11/include/',
    231           ],
    232         }],
    233         [ 'skia_os in ["win", "ios"]', {
    234           'sources!': [
    235             '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
    236             '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
    237           ],
    238         }],
    239         [ 'not skia_angle', {
    240           'sources!': [
    241             '<@(skgpu_angle_gl_sources)',
    242           ],
    243           'dependencies!': [
    244             'angle.gyp:*',
    245           ],
    246           'export_dependent_settings!': [
    247             'angle.gyp:*',
    248           ],
    249         }],
    250         [ 'skia_os == "android"', {
    251           'sources!': [
    252             '../src/gpu/gl/GrGLDefaultInterface_none.cpp',
    253             '../src/gpu/gl/GrGLCreateNativeInterface_none.cpp',
    254           ],
    255           'link_settings': {
    256             'libraries': [
    257               '-lGLESv2',
    258               '-lEGL',
    259             ],
    260           },
    261         }],
    262       ],
    263     },
    264   ],
    265 }
    266 
    267 # Local Variables:
    268 # tab-width:2
    269 # indent-tabs-mode:nil
    270 # End:
    271 # vim: set expandtab tabstop=2 shiftwidth=2:
    272