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)', |
scroggo@google.com | d4adfa3 | 2014-02-05 16:35:12 +0000 | [diff] [blame] | 48 | |
| 49 | 'skia_android_framework%': 0, |
epoger@google.com | 573e8ba | 2012-03-16 18:28:24 +0000 | [diff] [blame] | 50 | }, |
| 51 | |
| 52 | # Re-define all variables defined within the level-3 'variables' dict, |
| 53 | # so that siblings of the level-2 'variables' dict can see them. |
scroggo@google.com | d4adfa3 | 2014-02-05 16:35:12 +0000 | [diff] [blame] | 54 | # (skia_os will depend on skia_android_framework.) |
| 55 | 'skia_android_framework%': '<(skia_android_framework)', |
caryclark@google.com | 976298e | 2012-09-24 19:41:43 +0000 | [diff] [blame] | 56 | |
epoger@google.com | 573e8ba | 2012-03-16 18:28:24 +0000 | [diff] [blame] | 57 | 'conditions': [ |
scroggo@google.com | d4adfa3 | 2014-02-05 16:35:12 +0000 | [diff] [blame] | 58 | [ 'skia_android_framework == 1', { |
| 59 | 'skia_os%': 'android', |
| 60 | }, { |
| 61 | 'skia_os%': '<(skia_os)', |
| 62 | }], |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 63 | [ 'skia_os == "win"', { |
epoger@google.com | 573e8ba | 2012-03-16 18:28:24 +0000 | [diff] [blame] | 64 | 'os_posix%': 0, |
| 65 | }, { |
| 66 | 'os_posix%': 1, |
| 67 | }], |
commit-bot@chromium.org | 424fce3 | 2014-01-15 19:28:27 +0000 | [diff] [blame] | 68 | [ 'skia_os in ["linux", "win"]', { |
commit-bot@chromium.org | 83f5692 | 2014-01-09 22:54:26 +0000 | [diff] [blame] | 69 | 'skia_poppler_enabled%': 1, |
| 70 | }, { |
| 71 | 'skia_poppler_enabled%': 0, |
| 72 | }], |
commit-bot@chromium.org | b638a3a | 2014-01-14 20:49:26 +0000 | [diff] [blame] | 73 | [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "mac"]', { |
borenet@google.com | a37a517 | 2012-08-09 20:44:32 +0000 | [diff] [blame] | 74 | 'skia_arch_width%': 64, |
| 75 | }, { |
| 76 | 'skia_arch_width%': 32, |
| 77 | }], |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 78 | [ 'skia_os == "android"', { |
borenet@google.com | c2dd3d4 | 2012-09-11 21:37:28 +0000 | [diff] [blame] | 79 | 'skia_static_initializers%': 0, |
| 80 | }, { |
| 81 | 'skia_static_initializers%': 1, |
| 82 | }], |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 83 | [ 'skia_os == "ios"', { |
| 84 | 'skia_arch_type%': 'arm', |
djsollen@google.com | f7542ba | 2013-07-31 12:57:27 +0000 | [diff] [blame] | 85 | 'arm_version%': 7, |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 86 | 'arm_neon%': 0, # neon asm files known not to work with the ios build |
| 87 | },{ # skia_os is not ios |
| 88 | 'skia_arch_type%': 'x86', |
djsollen@google.com | f7542ba | 2013-07-31 12:57:27 +0000 | [diff] [blame] | 89 | 'arm_version%': 0, |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 90 | 'arm_neon%': 0, |
| 91 | }], |
epoger@google.com | 573e8ba | 2012-03-16 18:28:24 +0000 | [diff] [blame] | 92 | ], |
| 93 | |
mtklein@google.com | 9f3b0e4 | 2013-10-08 15:16:36 +0000 | [diff] [blame] | 94 | 'skia_sanitizer%': '', |
epoger@google.com | 573e8ba | 2012-03-16 18:28:24 +0000 | [diff] [blame] | 95 | 'skia_scalar%': 'float', |
| 96 | 'skia_mesa%': 0, |
sugoi@google.com | e3453cb | 2013-01-07 14:26:40 +0000 | [diff] [blame] | 97 | 'skia_stroke_path_rendering%': 0, |
jvanverth@google.com | 74dda90 | 2013-01-09 21:04:52 +0000 | [diff] [blame] | 98 | 'skia_android_path_rendering%': 0, |
robertphillips@google.com | 4e5559a | 2013-10-30 17:04:16 +0000 | [diff] [blame] | 99 | 'skia_resource_cache_mb_limit%': 0, |
| 100 | 'skia_resource_cache_count_limit%': 0, |
robertphillips@google.com | 021bce9 | 2012-04-02 20:42:26 +0000 | [diff] [blame] | 101 | 'skia_angle%': 0, |
robertphillips@google.com | 42cc237 | 2013-12-10 15:19:32 +0000 | [diff] [blame] | 102 | 'skia_chrome_utils%': 1, |
bungeman@google.com | e8f0592 | 2012-08-16 16:13:40 +0000 | [diff] [blame] | 103 | 'skia_directwrite%': 0, |
bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 104 | 'skia_gpu%': 1, |
senorblanco@chromium.org | 29f351a | 2014-01-20 16:14:02 +0000 | [diff] [blame] | 105 | 'skia_osx_deployment_target%': '', |
djsollen@google.com | 5afbbc4 | 2012-11-29 15:09:58 +0000 | [diff] [blame] | 106 | 'skia_profile_enabled%': 0, |
borenet@google.com | 663a979 | 2013-03-08 22:22:44 +0000 | [diff] [blame] | 107 | 'skia_win_debuggers_path%': '', |
djsollen@google.com | 52f0297 | 2013-06-03 12:10:19 +0000 | [diff] [blame] | 108 | 'skia_shared_lib%': 0, |
zachr@google.com | d658568 | 2013-07-17 19:29:19 +0000 | [diff] [blame] | 109 | 'skia_opencl%': 0, |
jvanverth@google.com | d830d13 | 2013-11-11 20:54:09 +0000 | [diff] [blame] | 110 | 'skia_distancefield_fonts%': 0, |
commit-bot@chromium.org | 06b3864 | 2013-06-20 20:28:54 +0000 | [diff] [blame] | 111 | |
| 112 | # These variables determine the default optimization level for different |
| 113 | # compilers. |
| 114 | 'skia_default_vs_optimization_level': 3, # full (/Ox) |
| 115 | 'skia_default_gcc_optimization_level': 3, # -O3 |
epoger@google.com | 573e8ba | 2012-03-16 18:28:24 +0000 | [diff] [blame] | 116 | }, |
| 117 | |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 118 | 'conditions': [ |
| 119 | [ 'skia_os == "win" and skia_arch_width == 32 or ' |
scroggo@google.com | d4adfa3 | 2014-02-05 16:35:12 +0000 | [diff] [blame] | 120 | 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "android"] ' |
| 121 | 'and skia_android_framework == 0 or ' |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 122 | 'skia_os == "mac" and skia_arch_width == 32', { |
| 123 | 'skia_warnings_as_errors%': 1, |
| 124 | }, { |
| 125 | 'skia_warnings_as_errors%': 0, |
| 126 | }], |
commit-bot@chromium.org | 06b3864 | 2013-06-20 20:28:54 +0000 | [diff] [blame] | 127 | |
| 128 | # This variable allows the user to customize the optimization level used |
| 129 | # by the compiler. The user should be aware that this has different |
| 130 | # meanings for different compilers and should exercise caution when |
| 131 | # overriding it. |
| 132 | [ 'skia_os == "win"', { |
| 133 | 'skia_release_optimization_level%': '<(skia_default_vs_optimization_level)', |
| 134 | }, { |
| 135 | 'skia_release_optimization_level%': '<(skia_default_gcc_optimization_level)', |
| 136 | }], |
mtklein@google.com | 9f3b0e4 | 2013-10-08 15:16:36 +0000 | [diff] [blame] | 137 | [ 'skia_sanitizer', { |
borenet@google.com | 47ae4b0 | 2013-08-21 18:02:50 +0000 | [diff] [blame] | 138 | 'skia_clang_build': 1, |
commit-bot@chromium.org | 5003bde | 2013-10-25 18:14:54 +0000 | [diff] [blame] | 139 | 'skia_keep_frame_pointer': 1, |
borenet@google.com | 47ae4b0 | 2013-08-21 18:02:50 +0000 | [diff] [blame] | 140 | }, { |
| 141 | 'skia_clang_build%': 0, |
commit-bot@chromium.org | 5003bde | 2013-10-25 18:14:54 +0000 | [diff] [blame] | 142 | 'skia_keep_frame_pointer%': 0, |
borenet@google.com | 47ae4b0 | 2013-08-21 18:02:50 +0000 | [diff] [blame] | 143 | }], |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 144 | ], |
| 145 | |
epoger@google.com | 573e8ba | 2012-03-16 18:28:24 +0000 | [diff] [blame] | 146 | # Re-define all variables defined within the level-2 'variables' dict, |
| 147 | # so that siblings of the level-1 'variables' dict can see them. |
djsollen@google.com | f7542ba | 2013-07-31 12:57:27 +0000 | [diff] [blame] | 148 | 'arm_version%': '<(arm_version)', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 149 | 'arm_neon%': '<(arm_neon)', |
djsollen@google.com | f7542ba | 2013-07-31 12:57:27 +0000 | [diff] [blame] | 150 | 'arm_neon_optional%': 0, |
epoger@google.com | 573e8ba | 2012-03-16 18:28:24 +0000 | [diff] [blame] | 151 | 'skia_os%': '<(skia_os)', |
| 152 | 'os_posix%': '<(os_posix)', |
mtklein@google.com | 9f3b0e4 | 2013-10-08 15:16:36 +0000 | [diff] [blame] | 153 | 'skia_sanitizer%': '<(skia_sanitizer)', |
epoger@google.com | 573e8ba | 2012-03-16 18:28:24 +0000 | [diff] [blame] | 154 | 'skia_scalar%': '<(skia_scalar)', |
| 155 | 'skia_mesa%': '<(skia_mesa)', |
sugoi@google.com | e3453cb | 2013-01-07 14:26:40 +0000 | [diff] [blame] | 156 | 'skia_stroke_path_rendering%': '<(skia_stroke_path_rendering)', |
scroggo@google.com | d4adfa3 | 2014-02-05 16:35:12 +0000 | [diff] [blame] | 157 | 'skia_android_framework%': '<(skia_android_framework)', |
jvanverth@google.com | 74dda90 | 2013-01-09 21:04:52 +0000 | [diff] [blame] | 158 | 'skia_android_path_rendering%': '<(skia_android_path_rendering)', |
robertphillips@google.com | 4e5559a | 2013-10-30 17:04:16 +0000 | [diff] [blame] | 159 | 'skia_resource_cache_mb_limit%': '<(skia_resource_cache_mb_limit)', |
| 160 | 'skia_resource_cache_count_limit%': '<(skia_resource_cache_count_limit)', |
robertphillips@google.com | 021bce9 | 2012-04-02 20:42:26 +0000 | [diff] [blame] | 161 | 'skia_angle%': '<(skia_angle)', |
commit-bot@chromium.org | 83f5692 | 2014-01-09 22:54:26 +0000 | [diff] [blame] | 162 | 'skia_poppler_enabled%': '<(skia_poppler_enabled)', |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 163 | 'skia_arch_width%': '<(skia_arch_width)', |
borenet@google.com | efb1d77 | 2012-10-10 19:45:51 +0000 | [diff] [blame] | 164 | 'skia_arch_type%': '<(skia_arch_type)', |
robertphillips@google.com | 42cc237 | 2013-12-10 15:19:32 +0000 | [diff] [blame] | 165 | 'skia_chrome_utils%': '<(skia_chrome_utils)', |
bungeman@google.com | e8f0592 | 2012-08-16 16:13:40 +0000 | [diff] [blame] | 166 | 'skia_directwrite%': '<(skia_directwrite)', |
bsalomon@google.com | cf8fb1f | 2012-08-02 14:03:32 +0000 | [diff] [blame] | 167 | 'skia_gpu%': '<(skia_gpu)', |
commit-bot@chromium.org | 5a6c2d8 | 2013-06-14 17:10:09 +0000 | [diff] [blame] | 168 | 'skia_win_exceptions%': 0, |
senorblanco@chromium.org | 29f351a | 2014-01-20 16:14:02 +0000 | [diff] [blame] | 169 | 'skia_osx_deployment_target%': '<(skia_osx_deployment_target)', |
djsollen@google.com | 5afbbc4 | 2012-11-29 15:09:58 +0000 | [diff] [blame] | 170 | 'skia_profile_enabled%': '<(skia_profile_enabled)', |
djsollen@google.com | 52f0297 | 2013-06-03 12:10:19 +0000 | [diff] [blame] | 171 | 'skia_shared_lib%': '<(skia_shared_lib)', |
zachr@google.com | d658568 | 2013-07-17 19:29:19 +0000 | [diff] [blame] | 172 | 'skia_opencl%': '<(skia_opencl)', |
jvanverth@google.com | d830d13 | 2013-11-11 20:54:09 +0000 | [diff] [blame] | 173 | 'skia_distancefield_fonts%': '<(skia_distancefield_fonts)', |
chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 174 | 'skia_static_initializers%': '<(skia_static_initializers)', |
bsalomon@google.com | 4663822 | 2012-10-04 12:52:03 +0000 | [diff] [blame] | 175 | 'ios_sdk_version%': '6.0', |
edisonn@google.com | 184487c | 2013-03-08 18:00:16 +0000 | [diff] [blame] | 176 | 'skia_win_debuggers_path%': '<(skia_win_debuggers_path)', |
commit-bot@chromium.org | ffd178c | 2013-11-11 15:10:47 +0000 | [diff] [blame] | 177 | 'skia_run_pdfviewer_in_gm%': 0, |
commit-bot@chromium.org | 35d4872 | 2014-02-13 18:36:36 +0000 | [diff] [blame] | 178 | 'skia_disable_inlining%': 0, |
chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 179 | |
reed@google.com | baa5d94 | 2012-08-08 20:39:17 +0000 | [diff] [blame] | 180 | # These are referenced by our .gypi files that list files (e.g. core.gypi) |
| 181 | # |
| 182 | 'skia_src_path%': '../src', |
| 183 | 'skia_include_path%': '../include', |
epoger@google.com | 573e8ba | 2012-03-16 18:28:24 +0000 | [diff] [blame] | 184 | }, |
| 185 | } |