epoger@google.com | 573e8ba | 2012-03-16 18:28:24 +0000 | [diff] [blame] | 1 | # Copyright 2012 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 | { |
| 7 | # Get ready for the ugly... |
| 8 | # |
| 9 | # - We have to nest our variables dictionaries multiple levels deep, so that |
| 10 | # this and other gyp files can rely on previously-set variable values in |
| 11 | # their 'variables': { 'conditions': [] } clauses. |
| 12 | # |
| 13 | # Example 1: |
| 14 | # Within this file, we use the value of variable 'skia_os' to set the |
| 15 | # value of variable 'os_posix', so 'skia_os' must be defined within a |
| 16 | # "more inner" (enclosed) scope than 'os_posix'. |
| 17 | # |
| 18 | # Example 2: |
| 19 | # http://src.chromium.org/viewvc/chrome/trunk/src/third_party/libjpeg/libjpeg.gyp?revision=102306 , |
| 20 | # which we currently import into our build, uses the value of 'os_posix' |
| 21 | # within the 'conditions' list in its 'variables' dict. |
| 22 | # In order for that to work, it needs the value of 'os_posix' to have been |
| 23 | # set within a "more inner" (enclosed) scope than its own 'variables' dict. |
| 24 | # |
| 25 | # - On the other hand, key/value pairs of a given 'variable' dict are only |
| 26 | # inherited by: |
| 27 | # 1. directly enclosing 'variable' dicts, and |
| 28 | # 2. "sibling" 'variable' dicts (which, I guess, are combined into a single |
| 29 | # 'variable' dict during gyp processing) |
| 30 | # and NOT inherited by "uncles" (siblings of directly enclosing 'variable' |
| 31 | # dicts), so we have to re-define every variable at every enclosure level |
| 32 | # within our ridiculous matryoshka doll of 'variable' dicts. That's why |
| 33 | # we have variable definitions like this: 'skia_os%': '<(skia_os)', |
| 34 | # |
| 35 | # See http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?revision=127004 , |
| 36 | # which deals with these same constraints in a similar manner. |
| 37 | # |
| 38 | 'variables': { # level 1 |
| 39 | 'variables': { # level 2 |
| 40 | |
| 41 | # Variables needed by conditions list within the level-2 variables dict. |
| 42 | 'variables': { # level 3 |
| 43 | # We use 'skia_os' instead of 'OS' throughout our gyp files, to allow |
| 44 | # for cross-compilation (e.g. building for either MacOS or iOS on Mac). |
| 45 | # We set it automatically based on 'OS' (the host OS), but allow the |
| 46 | # user to override it via GYP_DEFINES if they like. |
| 47 | 'skia_os%': '<(OS)', |
senorblanco@chromium.org | b8d212f | 2012-09-24 21:27:14 +0000 | [diff] [blame] | 48 | 'skia_arch_type%': 'x86', |
epoger@google.com | 573e8ba | 2012-03-16 18:28:24 +0000 | [diff] [blame] | 49 | }, |
| 50 | |
| 51 | # Re-define all variables defined within the level-3 'variables' dict, |
| 52 | # so that siblings of the level-2 'variables' dict can see them. |
| 53 | 'skia_os%': '<(skia_os)', |
senorblanco@chromium.org | b8d212f | 2012-09-24 21:27:14 +0000 | [diff] [blame] | 54 | 'skia_arch_type%': '<(skia_arch_type)', |
caryclark@google.com | 976298e | 2012-09-24 19:41:43 +0000 | [diff] [blame] | 55 | |
epoger@google.com | 573e8ba | 2012-03-16 18:28:24 +0000 | [diff] [blame] | 56 | 'conditions': [ |
| 57 | ['skia_os == "win"', { |
| 58 | 'os_posix%': 0, |
| 59 | }, { |
| 60 | 'os_posix%': 1, |
| 61 | }], |
borenet@google.com | a37a517 | 2012-08-09 20:44:32 +0000 | [diff] [blame] | 62 | ['skia_os in ["linux", "freebsd", "openbsd", "solaris"]', { |
| 63 | 'skia_arch_width%': 64, |
| 64 | }, { |
| 65 | 'skia_arch_width%': 32, |
| 66 | }], |
borenet@google.com | c2dd3d4 | 2012-09-11 21:37:28 +0000 | [diff] [blame] | 67 | ['skia_os == "android"', { |
| 68 | 'skia_static_initializers%': 0, |
| 69 | }, { |
| 70 | 'skia_static_initializers%': 1, |
| 71 | }], |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 72 | [ 'skia_arch_type == "x86"', { |
| 73 | 'ios_sdk_dir%': '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator', |
| 74 | }, { |
| 75 | 'ios_sdk_dir%': '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS', |
| 76 | }], |
epoger@google.com | 573e8ba | 2012-03-16 18:28:24 +0000 | [diff] [blame] | 77 | ], |
| 78 | |
| 79 | 'skia_scalar%': 'float', |
| 80 | 'skia_mesa%': 0, |
bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 81 | 'skia_nv_path_rendering%': 0, |
robertphillips@google.com | 021bce9 | 2012-04-02 20:42:26 +0000 | [diff] [blame] | 82 | 'skia_angle%': 0, |
bungeman@google.com | e8f0592 | 2012-08-16 16:13:40 +0000 | [diff] [blame] | 83 | 'skia_directwrite%': 0, |
borenet@google.com | 7ef3929 | 2012-07-18 14:59:54 +0000 | [diff] [blame] | 84 | 'android_make_apk%': 1, |
borenet@google.com | a98eb91 | 2012-09-04 21:09:40 +0000 | [diff] [blame] | 85 | 'skia_nacl%': 0, |
bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 86 | 'skia_gpu%': 1, |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 87 | 'ios_sdk_version%': '5.1', |
mike@reedtribe.org | 9a520eb | 2012-09-26 03:08:16 +0000 | [diff] [blame^] | 88 | 'skia_osx_sdkroot%': 'macosx10.6', |
epoger@google.com | 573e8ba | 2012-03-16 18:28:24 +0000 | [diff] [blame] | 89 | }, |
| 90 | |
| 91 | # Re-define all variables defined within the level-2 'variables' dict, |
| 92 | # so that siblings of the level-1 'variables' dict can see them. |
| 93 | 'skia_os%': '<(skia_os)', |
| 94 | 'os_posix%': '<(os_posix)', |
| 95 | 'skia_scalar%': '<(skia_scalar)', |
| 96 | 'skia_mesa%': '<(skia_mesa)', |
bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 97 | 'skia_nv_path_rendering%': '<(skia_nv_path_rendering)', |
robertphillips@google.com | 021bce9 | 2012-04-02 20:42:26 +0000 | [diff] [blame] | 98 | 'skia_angle%': '<(skia_angle)', |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 99 | 'skia_arch_type%': '<(skia_arch_type)', |
| 100 | 'skia_arch_width%': '<(skia_arch_width)', |
bungeman@google.com | e8f0592 | 2012-08-16 16:13:40 +0000 | [diff] [blame] | 101 | 'skia_directwrite%': '<(skia_directwrite)', |
borenet@google.com | 7ef3929 | 2012-07-18 14:59:54 +0000 | [diff] [blame] | 102 | 'android_make_apk%': '<(android_make_apk)', |
borenet@google.com | a98eb91 | 2012-09-04 21:09:40 +0000 | [diff] [blame] | 103 | 'skia_nacl%': '<(skia_nacl)', |
bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 104 | 'skia_gpu%': '<(skia_gpu)', |
senorblanco@chromium.org | bc5cbfe | 2012-09-20 16:10:02 +0000 | [diff] [blame] | 105 | 'skia_osx_sdkroot%': '<(skia_osx_sdkroot)', |
chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 106 | 'skia_static_initializers%': '<(skia_static_initializers)', |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 107 | 'ios_sdk_version%': '<(ios_sdk_version)', |
| 108 | 'ios_sdk_dir%': '<(ios_sdk_dir)', |
chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 109 | |
reed@google.com | baa5d94 | 2012-08-08 20:39:17 +0000 | [diff] [blame] | 110 | # These are referenced by our .gypi files that list files (e.g. core.gypi) |
| 111 | # |
| 112 | 'skia_src_path%': '../src', |
| 113 | 'skia_include_path%': '../include', |
epoger@google.com | 573e8ba | 2012-03-16 18:28:24 +0000 | [diff] [blame] | 114 | }, |
| 115 | } |
| 116 | # Local Variables: |
| 117 | # tab-width:2 |
| 118 | # indent-tabs-mode:nil |
| 119 | # End: |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 120 | # vim: set expandtab tabstop=2 shiftwidth=2: |