senorblanco@chromium.org | afac888 | 2011-04-11 15:59:47 +0000 | [diff] [blame] | 1 | # Copyright (C) 2011 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | { |
epoger@google.com | 8846cb2 | 2011-07-01 20:20:07 +0000 | [diff] [blame] | 15 | # Define all variables, allowing for override in GYP_DEFINES. |
| 16 | # |
| 17 | # One such variable is 'skia_os', which we use instead of 'OS' throughout |
| 18 | # our gyp files. We set it automatically based on 'OS', but allow the |
| 19 | # user to override it via GYP_DEFINES if they like. |
| 20 | 'variables': { |
| 21 | 'skia_scalar%': 'float', |
| 22 | 'skia_os%': '<(OS)', |
| 23 | }, |
| 24 | 'skia_scalar%': '<(skia_scalar)', |
| 25 | 'skia_os': '<(skia_os)', |
| 26 | |
epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 27 | 'target_defaults': { |
| 28 | |
epoger@google.com | 8846cb2 | 2011-07-01 20:20:07 +0000 | [diff] [blame] | 29 | # Validate the 'skia_os' setting against 'OS', because only certain |
| 30 | # combinations work. You should only override 'skia_os' for certain |
| 31 | # situations, like building for iOS on a Mac. |
epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 32 | 'variables': { |
epoger@google.com | 8846cb2 | 2011-07-01 20:20:07 +0000 | [diff] [blame] | 33 | 'conditions': [ |
| 34 | ['skia_os != OS and not (skia_os == "ios" and OS == "mac")', |
| 35 | {'error': '<!(Cannot build with skia_os=<(skia_os) on OS=<(OS))'}], |
| 36 | ], |
epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 37 | }, |
epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 38 | |
| 39 | 'configurations': { |
| 40 | 'Debug': { |
| 41 | 'defines': [ |
| 42 | 'SK_DEBUG', |
| 43 | 'GR_DEBUG=1', |
| 44 | ], |
| 45 | }, |
| 46 | 'Release': { |
| 47 | 'defines': [ |
| 48 | 'SK_RELEASE', |
| 49 | 'GR_RELEASE=1', |
| 50 | ], |
| 51 | }, |
| 52 | }, |
| 53 | |
| 54 | 'conditions' : [ |
| 55 | |
| 56 | [ 'skia_scalar == "float"', |
| 57 | { |
| 58 | 'defines': [ |
| 59 | 'SK_SCALAR_IS_FLOAT', |
| 60 | 'SK_CAN_USE_FLOAT', |
| 61 | ], |
| 62 | }, { # else, skia_scalar != "float" |
| 63 | 'defines': [ |
| 64 | 'SK_SCALAR_IS_FIXED', |
| 65 | 'SK_CAN_USE_FLOAT', # we can still use floats along the way |
| 66 | ], |
| 67 | } |
| 68 | ], |
| 69 | |
epoger@google.com | 8846cb2 | 2011-07-01 20:20:07 +0000 | [diff] [blame] | 70 | ['skia_os == "win"', |
epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 71 | { |
| 72 | 'defines': [ |
| 73 | 'SK_BUILD_FOR_WIN32', |
| 74 | 'SK_IGNORE_STDINT_DOT_H', |
| 75 | ], |
senorblanco@chromium.org | afac888 | 2011-04-11 15:59:47 +0000 | [diff] [blame] | 76 | 'msvs_cygwin_shell': 0, |
| 77 | 'msvs_settings': { |
| 78 | 'VCCLCompilerTool': { |
| 79 | 'WarningLevel': '1', |
| 80 | 'WarnAsError': 'false', |
| 81 | 'DebugInformationFormat': '3', |
| 82 | 'AdditionalOptions': '/MP', |
| 83 | }, |
epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 84 | 'VCLinkerTool': { |
| 85 | 'AdditionalDependencies': [ |
| 86 | 'OpenGL32.lib', |
| 87 | 'usp10.lib', |
| 88 | ], |
| 89 | }, |
senorblanco@chromium.org | afac888 | 2011-04-11 15:59:47 +0000 | [diff] [blame] | 90 | }, |
| 91 | 'configurations': { |
| 92 | 'Debug': { |
| 93 | 'msvs_settings': { |
| 94 | 'VCCLCompilerTool': { |
| 95 | 'Optimization': '0', # 0 = /Od |
| 96 | 'PreprocessorDefinitions': ['_DEBUG'], |
| 97 | 'RuntimeLibrary': '3', # 3 = /MDd (debug DLL) |
| 98 | }, |
| 99 | 'VCLinkerTool': { |
| 100 | 'GenerateDebugInformation': 'true', |
| 101 | }, |
| 102 | }, |
| 103 | }, |
| 104 | 'Release': { |
| 105 | 'msvs_settings': { |
| 106 | 'VCCLCompilerTool': { |
| 107 | 'Optimization': '2', # 2 = /Os |
| 108 | 'PreprocessorDefinitions': ['NDEBUG'], |
| 109 | 'RuntimeLibrary': '2', # 2 = /MD (nondebug DLL) |
| 110 | }, |
| 111 | 'VCLinkerTool': { |
| 112 | 'GenerateDebugInformation': 'false', |
| 113 | }, |
| 114 | }, |
| 115 | }, |
| 116 | }, |
| 117 | }, |
epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 118 | ], |
| 119 | |
epoger@google.com | 8846cb2 | 2011-07-01 20:20:07 +0000 | [diff] [blame] | 120 | ['skia_os in ["linux", "freebsd", "openbsd", "solaris"]', |
epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 121 | { |
| 122 | 'defines': [ |
| 123 | 'SK_SAMPLES_FOR_X', |
| 124 | 'SK_BUILD_FOR_UNIX', |
| 125 | ], |
senorblanco@chromium.org | afac888 | 2011-04-11 15:59:47 +0000 | [diff] [blame] | 126 | 'configurations': { |
| 127 | 'Debug': { |
| 128 | 'cflags': ['-g'] |
| 129 | }, |
| 130 | 'Release': { |
| 131 | 'cflags': ['-O2'] |
| 132 | }, |
| 133 | }, |
epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 134 | 'cflags': [ '-Wall', '-Wextra', '-Wno-unused' ], |
| 135 | 'include_dirs' : [ |
| 136 | '/usr/include/freetype2', |
| 137 | ], |
senorblanco@chromium.org | afac888 | 2011-04-11 15:59:47 +0000 | [diff] [blame] | 138 | }, |
epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 139 | ], |
| 140 | |
epoger@google.com | 8846cb2 | 2011-07-01 20:20:07 +0000 | [diff] [blame] | 141 | ['skia_os == "mac"', |
epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 142 | { |
| 143 | 'defines': [ |
| 144 | 'SK_BUILD_FOR_MAC', |
| 145 | ], |
senorblanco@chromium.org | afac888 | 2011-04-11 15:59:47 +0000 | [diff] [blame] | 146 | 'configurations': { |
| 147 | 'Debug': { |
| 148 | 'cflags': ['-g'] |
| 149 | }, |
| 150 | 'Release': { |
| 151 | 'cflags': ['-O2'] |
| 152 | }, |
| 153 | }, |
epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 154 | 'xcode_settings': { |
| 155 | 'SYMROOT': '<(DEPTH)/xcodebuild', |
| 156 | }, |
senorblanco@chromium.org | afac888 | 2011-04-11 15:59:47 +0000 | [diff] [blame] | 157 | }, |
epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 158 | ], |
| 159 | |
epoger@google.com | ea5dfa8 | 2011-07-01 21:01:32 +0000 | [diff] [blame^] | 160 | ['skia_os == "ios"', |
| 161 | { |
| 162 | 'defines': [ |
| 163 | 'SK_BUILD_FOR_IOS', |
| 164 | ], |
| 165 | 'configurations': { |
| 166 | 'Debug': { |
| 167 | 'cflags': ['-g'] |
| 168 | }, |
| 169 | 'Release': { |
| 170 | 'cflags': ['-O2'] |
| 171 | }, |
| 172 | }, |
| 173 | 'xcode_settings': { |
| 174 | 'SYMROOT': '<(DEPTH)/xcodebuild', |
| 175 | }, |
| 176 | }, |
| 177 | ], |
| 178 | |
epoger@google.com | 5351b37 | 2011-07-01 17:16:26 +0000 | [diff] [blame] | 179 | ], # end 'conditions' |
| 180 | }, # end 'target_defaults' |
senorblanco@chromium.org | afac888 | 2011-04-11 15:59:47 +0000 | [diff] [blame] | 181 | } |
| 182 | # Local Variables: |
| 183 | # tab-width:2 |
| 184 | # indent-tabs-mode:nil |
| 185 | # End: |
| 186 | # vim: set expandtab tabstop=2 shiftwidth=2: |