Home | History | Annotate | Download | only in gyp
      1 # Copyright 2011 The Android Open Source Project
      2 #
      3 # Use of this source code is governed by a BSD-style license that can be
      4 # found in the LICENSE file.
      5 #
      6 # This file is automatically included by gyp_skia when building any target.
      7 
      8 {
      9   'includes': [
     10     'common_variables.gypi',
     11   ],
     12 
     13   'target_defaults': {
     14     'defines': [
     15       'SK_INTERNAL',
     16       'SK_GAMMA_SRGB',
     17       'SK_GAMMA_APPLY_TO_A8',
     18       'SK_SCALAR_TO_FLOAT_EXCLUDED',  # temporary to allow Chrome to call SkFloatToScalar
     19       # 'SK_USE_DISCARDABLE_SCALEDIMAGECACHE',  # TODO(reed): Re-enable when tests don't crash with this.
     20     ],
     21 
     22     # Validate the 'skia_os' setting against 'OS', because only certain
     23     # combinations work.  You should only override 'skia_os' for certain
     24     # situations, like building for iOS on a Mac.
     25     'variables': {
     26       'conditions': [
     27         [ 'skia_os != OS and not ((skia_os == "ios" and OS == "mac") or \
     28                                   (skia_os == "nacl" and OS == "linux") or \
     29                                   (skia_os == "chromeos" and OS == "linux"))', {
     30           'error': '<!(Cannot build with skia_os=<(skia_os) on OS=<(OS))',
     31         }],
     32         [ 'skia_mesa and skia_os not in ["mac", "linux"]', {
     33           'error': '<!(skia_mesa=1 only supported with skia_os="mac" or "linux".)',
     34         }],
     35         [ 'skia_angle and not skia_os == "win"', {
     36           'error': '<!(skia_angle=1 only supported with skia_os="win".)',
     37         }],
     38         [ 'skia_arch_width != 32 and skia_arch_width != 64', {
     39           'error': '<!(skia_arch_width can only be 32 or 64 bits not <(skia_arch_width) bits)',
     40         }],
     41         [ 'skia_os == "nacl" and OS != "linux"', {
     42           'error': '<!(Skia NaCl build only currently supported on Linux.)',
     43         }],
     44         [ 'skia_os == "chromeos" and OS != "linux"', {
     45           'error': '<!(Skia ChromeOS build is only supported on Linux.)',
     46         }],
     47       ],
     48     },
     49     'includes': [
     50       'common_conditions.gypi',
     51     ],
     52     'conditions': [
     53       [ 'skia_scalar == "float"',
     54         {
     55           'defines': [
     56             'SK_SCALAR_IS_FLOAT',
     57           ],
     58         }, { # else, skia_scalar != "float"
     59           'defines': [
     60             'SK_SCALAR_IS_FIXED',
     61           ],
     62         }
     63       ],
     64       [ 'skia_mesa', {
     65         'defines': [
     66           'SK_MESA',
     67         ],
     68         'direct_dependent_settings': {
     69           'defines': [
     70             'SK_MESA',
     71           ],
     72         },
     73       }],
     74       [ 'skia_angle', {
     75         'defines': [
     76           'SK_ANGLE',
     77         ],
     78         'direct_dependent_settings': {
     79           'defines': [
     80             'SK_ANGLE',
     81           ],
     82         },
     83       }],
     84       [ 'skia_win_debuggers_path and skia_os == "win"',
     85         {
     86           'defines': [
     87             'SK_USE_CDB',
     88           ],
     89         },
     90       ],
     91       [ 'skia_android_framework==0', {
     92         # These defines are not used for skia_android_framework, where we build
     93         # one makefile and allow someone to add SK_DEBUG etc for their own
     94         # debugging purposes.
     95         'configurations': {
     96           'Debug':   { 'defines': [ 'SK_DEVELOPER=1' ] },
     97           'Release': { 'defines': [ 'NDEBUG' ] },
     98           'Release_Developer': {
     99             'inherit_from': ['Release'],
    100             'defines': [ 'SK_DEVELOPER=1' ],
    101           },
    102         },
    103       }],
    104     ],
    105   }, # end 'target_defaults'
    106 }
    107