| epoger@google.com | fd03db0 | 2011-07-28 14:24:55 +0000 | [diff] [blame] | 1 | # Copyright 2011 The Android Open Source Project |
| senorblanco@chromium.org | afac888 | 2011-04-11 15:59:47 +0000 | [diff] [blame] | 2 | # |
| epoger@google.com | fd03db0 | 2011-07-28 14:24:55 +0000 | [diff] [blame] | 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| epoger@google.com | aa3b6a9 | 2012-03-16 13:52:49 +0000 | [diff] [blame^] | 5 | # |
| 6 | # This file is automatically included by gyp_skia when building any target. |
| 7 | |
| senorblanco@chromium.org | afac888 | 2011-04-11 15:59:47 +0000 | [diff] [blame] | 8 | { |
| epoger@google.com | aa3b6a9 | 2012-03-16 13:52:49 +0000 | [diff] [blame^] | 9 | # Define all variables, allowing for override in GYP_DEFINES. |
| 10 | # |
| 11 | # One such variable is 'skia_os', which we use instead of 'OS' throughout |
| 12 | # our gyp files. We set it automatically based on 'OS', but allow the |
| 13 | # user to override it via GYP_DEFINES if they like. |
| 14 | 'variables': { |
| 15 | 'skia_scalar%': 'float', |
| 16 | 'skia_os%': '<(OS)', |
| 17 | 'skia_mesa%': 0, |
| 18 | 'skia_target_arch%': 'x86', |
| 19 | }, |
| 20 | |
| epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 21 | 'target_defaults': { |
| 22 | |
| epoger@google.com | 8846cb2 | 2011-07-01 20:20:07 +0000 | [diff] [blame] | 23 | # Validate the 'skia_os' setting against 'OS', because only certain |
| 24 | # combinations work. You should only override 'skia_os' for certain |
| 25 | # situations, like building for iOS on a Mac. |
| epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 26 | 'variables': { |
| epoger@google.com | 8846cb2 | 2011-07-01 20:20:07 +0000 | [diff] [blame] | 27 | 'conditions': [ |
| 28 | ['skia_os != OS and not (skia_os == "ios" and OS == "mac")', |
| 29 | {'error': '<!(Cannot build with skia_os=<(skia_os) on OS=<(OS))'}], |
| bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 30 | ['skia_mesa and skia_os not in ["mac", "linux"]', |
| 31 | {'error': '<!(skia_mesa=1 only supported with skia_os="mac" or "linux".)'}], |
| epoger@google.com | 8846cb2 | 2011-07-01 20:20:07 +0000 | [diff] [blame] | 32 | ], |
| epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 33 | }, |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 34 | 'includes': [ |
| 35 | 'common_conditions.gypi' |
| 36 | ], |
| 37 | 'conditions': [ |
| 38 | [ 'skia_scalar == "float"', |
| 39 | { |
| 40 | 'defines': [ |
| 41 | 'SK_SCALAR_IS_FLOAT', |
| 42 | 'SK_CAN_USE_FLOAT', |
| 43 | ], |
| 44 | }, { # else, skia_scalar != "float" |
| 45 | 'defines': [ |
| 46 | 'SK_SCALAR_IS_FIXED', |
| 47 | 'SK_CAN_USE_FLOAT', # we can still use floats along the way |
| 48 | ], |
| 49 | } |
| 50 | ], |
| bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 51 | [ 'skia_mesa', { |
| 52 | 'defines': [ |
| 53 | 'SK_MESA', |
| 54 | ], |
| 55 | 'direct_dependent_settings': { |
| 56 | 'defines': [ |
| 57 | 'SK_MESA', |
| 58 | ], |
| 59 | }, |
| 60 | }], |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 61 | ], |
| epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 62 | 'configurations': { |
| 63 | 'Debug': { |
| 64 | 'defines': [ |
| 65 | 'SK_DEBUG', |
| 66 | 'GR_DEBUG=1', |
| 67 | ], |
| 68 | }, |
| 69 | 'Release': { |
| 70 | 'defines': [ |
| 71 | 'SK_RELEASE', |
| 72 | 'GR_RELEASE=1', |
| 73 | ], |
| 74 | }, |
| 75 | }, |
| epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 76 | }, # end 'target_defaults' |
| senorblanco@chromium.org | afac888 | 2011-04-11 15:59:47 +0000 | [diff] [blame] | 77 | } |
| 78 | # Local Variables: |
| 79 | # tab-width:2 |
| 80 | # indent-tabs-mode:nil |
| 81 | # End: |
| 82 | # vim: set expandtab tabstop=2 shiftwidth=2: |