blob: 3f7b154b6f94781f014501e7a8984229dd4a5fa0 [file] [log] [blame]
epoger@google.com573e8ba2012-03-16 18:28:24 +00001# 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)',
48 },
49
50 # Re-define all variables defined within the level-3 'variables' dict,
51 # so that siblings of the level-2 'variables' dict can see them.
52 'skia_os%': '<(skia_os)',
caryclark@google.com976298e2012-09-24 19:41:43 +000053
epoger@google.com573e8ba2012-03-16 18:28:24 +000054 'conditions': [
borenet@google.comefb1d772012-10-10 19:45:51 +000055 [ 'skia_os == "win"', {
epoger@google.com573e8ba2012-03-16 18:28:24 +000056 'os_posix%': 0,
57 }, {
58 'os_posix%': 1,
59 }],
borenet@google.comefb1d772012-10-10 19:45:51 +000060 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
borenet@google.coma37a5172012-08-09 20:44:32 +000061 'skia_arch_width%': 64,
62 }, {
63 'skia_arch_width%': 32,
64 }],
borenet@google.comefb1d772012-10-10 19:45:51 +000065 [ 'skia_os == "android"', {
borenet@google.comc2dd3d42012-09-11 21:37:28 +000066 'skia_static_initializers%': 0,
67 }, {
68 'skia_static_initializers%': 1,
69 }],
borenet@google.comefb1d772012-10-10 19:45:51 +000070 [ 'skia_os == "ios"', {
71 'skia_arch_type%': 'arm',
djsollen@google.comf7542ba2013-07-31 12:57:27 +000072 'arm_version%': 7,
borenet@google.comefb1d772012-10-10 19:45:51 +000073 'arm_neon%': 0, # neon asm files known not to work with the ios build
74 },{ # skia_os is not ios
75 'skia_arch_type%': 'x86',
djsollen@google.comf7542ba2013-07-31 12:57:27 +000076 'arm_version%': 0,
borenet@google.comefb1d772012-10-10 19:45:51 +000077 'arm_neon%': 0,
78 }],
epoger@google.com573e8ba2012-03-16 18:28:24 +000079 ],
80
borenet@google.com47ae4b02013-08-21 18:02:50 +000081 'skia_asan_build%': 0,
bungeman@google.com1435f9f2013-09-25 22:39:22 +000082 'skia_tsan_build%': 0,
epoger@google.com573e8ba2012-03-16 18:28:24 +000083 'skia_scalar%': 'float',
84 'skia_mesa%': 0,
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000085 'skia_nv_path_rendering%': 0,
sugoi@google.come3453cb2013-01-07 14:26:40 +000086 'skia_stroke_path_rendering%': 0,
jvanverth@google.com74dda902013-01-09 21:04:52 +000087 'skia_android_path_rendering%': 0,
djsollen@google.com42041e62012-10-29 19:24:45 +000088 'skia_texture_cache_mb_limit%': 0,
robertphillips@google.com021bce92012-04-02 20:42:26 +000089 'skia_angle%': 0,
bungeman@google.come8f05922012-08-16 16:13:40 +000090 'skia_directwrite%': 0,
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +000091 'skia_gpu%': 1,
humper@google.com522dbd22013-02-08 21:45:33 +000092 'skia_osx_sdkroot%': '',
djsollen@google.com5afbbc42012-11-29 15:09:58 +000093 'skia_profile_enabled%': 0,
borenet@google.com663a9792013-03-08 22:22:44 +000094 'skia_win_debuggers_path%': '',
djsollen@google.com52f02972013-06-03 12:10:19 +000095 'skia_shared_lib%': 0,
zachr@google.comd6585682013-07-17 19:29:19 +000096 'skia_opencl%': 0,
commit-bot@chromium.org06b38642013-06-20 20:28:54 +000097
98 # These variables determine the default optimization level for different
99 # compilers.
100 'skia_default_vs_optimization_level': 3, # full (/Ox)
101 'skia_default_gcc_optimization_level': 3, # -O3
epoger@google.com573e8ba2012-03-16 18:28:24 +0000102 },
103
borenet@google.coma72aef82013-03-22 13:16:06 +0000104 'conditions': [
105 [ 'skia_os == "win" and skia_arch_width == 32 or '
106 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "android"] or '
107 'skia_os == "mac" and skia_arch_width == 32', {
108 'skia_warnings_as_errors%': 1,
109 }, {
110 'skia_warnings_as_errors%': 0,
111 }],
commit-bot@chromium.org06b38642013-06-20 20:28:54 +0000112
113 # This variable allows the user to customize the optimization level used
114 # by the compiler. The user should be aware that this has different
115 # meanings for different compilers and should exercise caution when
116 # overriding it.
117 [ 'skia_os == "win"', {
118 'skia_release_optimization_level%': '<(skia_default_vs_optimization_level)',
119 }, {
120 'skia_release_optimization_level%': '<(skia_default_gcc_optimization_level)',
121 }],
bungeman@google.com1435f9f2013-09-25 22:39:22 +0000122 [ 'skia_asan_build or skia_tsan_build', {
borenet@google.com47ae4b02013-08-21 18:02:50 +0000123 'skia_clang_build': 1,
124 }, {
125 'skia_clang_build%': 0,
126 }],
borenet@google.coma72aef82013-03-22 13:16:06 +0000127 ],
128
epoger@google.com573e8ba2012-03-16 18:28:24 +0000129 # Re-define all variables defined within the level-2 'variables' dict,
130 # so that siblings of the level-1 'variables' dict can see them.
djsollen@google.comf7542ba2013-07-31 12:57:27 +0000131 'arm_version%': '<(arm_version)',
borenet@google.comefb1d772012-10-10 19:45:51 +0000132 'arm_neon%': '<(arm_neon)',
djsollen@google.comf7542ba2013-07-31 12:57:27 +0000133 'arm_neon_optional%': 0,
epoger@google.com573e8ba2012-03-16 18:28:24 +0000134 'skia_os%': '<(skia_os)',
135 'os_posix%': '<(os_posix)',
borenet@google.com47ae4b02013-08-21 18:02:50 +0000136 'skia_asan_build%': '<(skia_asan_build)',
bungeman@google.com1435f9f2013-09-25 22:39:22 +0000137 'skia_tsan_build%': '<(skia_tsan_build)',
epoger@google.com573e8ba2012-03-16 18:28:24 +0000138 'skia_scalar%': '<(skia_scalar)',
139 'skia_mesa%': '<(skia_mesa)',
bsalomon@google.comded4f4b2012-06-28 18:48:06 +0000140 'skia_nv_path_rendering%': '<(skia_nv_path_rendering)',
sugoi@google.come3453cb2013-01-07 14:26:40 +0000141 'skia_stroke_path_rendering%': '<(skia_stroke_path_rendering)',
jvanverth@google.com74dda902013-01-09 21:04:52 +0000142 'skia_android_path_rendering%': '<(skia_android_path_rendering)',
djsollen@google.com42041e62012-10-29 19:24:45 +0000143 'skia_texture_cache_mb_limit%': '<(skia_texture_cache_mb_limit)',
robertphillips@google.com021bce92012-04-02 20:42:26 +0000144 'skia_angle%': '<(skia_angle)',
djsollen@google.come341cb32012-06-28 16:08:05 +0000145 'skia_arch_width%': '<(skia_arch_width)',
borenet@google.comefb1d772012-10-10 19:45:51 +0000146 'skia_arch_type%': '<(skia_arch_type)',
bungeman@google.come8f05922012-08-16 16:13:40 +0000147 'skia_directwrite%': '<(skia_directwrite)',
bsalomon@google.comcf8fb1f2012-08-02 14:03:32 +0000148 'skia_gpu%': '<(skia_gpu)',
commit-bot@chromium.org5a6c2d82013-06-14 17:10:09 +0000149 'skia_win_exceptions%': 0,
senorblanco@chromium.orgbc5cbfe2012-09-20 16:10:02 +0000150 'skia_osx_sdkroot%': '<(skia_osx_sdkroot)',
djsollen@google.com5afbbc42012-11-29 15:09:58 +0000151 'skia_profile_enabled%': '<(skia_profile_enabled)',
djsollen@google.com52f02972013-06-03 12:10:19 +0000152 'skia_shared_lib%': '<(skia_shared_lib)',
zachr@google.comd6585682013-07-17 19:29:19 +0000153 'skia_opencl%': '<(skia_opencl)',
chudy@google.combbad34d2012-08-13 14:26:36 +0000154 'skia_static_initializers%': '<(skia_static_initializers)',
bsalomon@google.com46638222012-10-04 12:52:03 +0000155 'ios_sdk_version%': '6.0',
edisonn@google.com184487c2013-03-08 18:00:16 +0000156 'skia_win_debuggers_path%': '<(skia_win_debuggers_path)',
chudy@google.combbad34d2012-08-13 14:26:36 +0000157
reed@google.combaa5d942012-08-08 20:39:17 +0000158 # These are referenced by our .gypi files that list files (e.g. core.gypi)
159 #
160 'skia_src_path%': '../src',
161 'skia_include_path%': '../include',
epoger@google.com573e8ba2012-03-16 18:28:24 +0000162 },
163}
164# Local Variables:
165# tab-width:2
166# indent-tabs-mode:nil
167# End:
rmistry@google.comd6176b02012-08-23 18:14:13 +0000168# vim: set expandtab tabstop=2 shiftwidth=2: