scroggo | 3e56227 | 2015-03-25 10:22:41 -0700 | [diff] [blame] | 1 | # Copyright 2015 Google Inc. |
| 2 | # |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
mtklein | dee3df9 | 2015-03-26 05:30:44 -0700 | [diff] [blame] | 5 | |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 6 | # conditions used in both common.gypi and skia.gyp in chromium |
| 7 | # |
| 8 | { |
chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 9 | 'defines': [ |
| 10 | 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=<(skia_static_initializers)', |
mtklein@google.com | dad7070 | 2013-11-20 18:06:10 +0000 | [diff] [blame] | 11 | 'SK_SUPPORT_GPU=<(skia_gpu)', |
jvanverth | 4736e14 | 2014-11-07 07:12:46 -0800 | [diff] [blame] | 12 | 'SK_FORCE_DISTANCE_FIELD_TEXT=<(skia_force_distance_field_text)', |
mtklein | 8d7f5c3 | 2016-08-01 09:22:12 -0700 | [diff] [blame] | 13 | |
msarett | ad3a5c6 | 2016-05-06 07:21:26 -0700 | [diff] [blame] | 14 | # Indicate that all dependency libraries are present. Clients that |
| 15 | # are missing some of the required decoding libraries may choose |
| 16 | # not to define these. This will disable some decoder and encoder |
| 17 | # features. |
msarett | ad3a5c6 | 2016-05-06 07:21:26 -0700 | [diff] [blame] | 18 | 'SK_HAS_JPEG_LIBRARY', |
| 19 | 'SK_HAS_PNG_LIBRARY', |
| 20 | 'SK_HAS_WEBP_LIBRARY', |
chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 21 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 22 | 'conditions' : [ |
bsalomon | ad514d0 | 2016-03-02 14:44:15 -0800 | [diff] [blame] | 23 | [ 'skia_is_bot', { |
| 24 | 'defines': [ 'SK_IS_BOT' ], |
| 25 | }], |
scroggo | 1497f9f | 2016-02-02 11:56:33 -0800 | [diff] [blame] | 26 | [ 'skia_codec_decodes_raw', { |
| 27 | 'defines': [ |
| 28 | 'SK_CODEC_DECODES_RAW', |
| 29 | ], |
| 30 | }], |
scroggo | c0bc913 | 2014-07-22 12:09:30 -0700 | [diff] [blame] | 31 | ['skia_pic', { |
| 32 | 'cflags': [ |
| 33 | '-fPIC', |
| 34 | ], |
| 35 | 'conditions' : [ |
| 36 | # FIXME: The reason we don't do this on Android is due to the way |
| 37 | # we build the executables/skia_launcher on Android. See |
| 38 | # https://codereview.chromium.org/406613003/diff/1/gyp/common_conditions.gypi#newcode455 |
| 39 | ['skia_os != "android"', { |
| 40 | 'target_conditions': [ |
| 41 | [ '_type == "executable"', { |
| 42 | 'cflags': [ '-fPIE' ], |
| 43 | 'ldflags': [ '-pie' ], |
| 44 | }], |
| 45 | ], |
| 46 | }], |
| 47 | ], |
| 48 | }], |
commit-bot@chromium.org | 6f2d4d4 | 2014-04-02 15:03:56 +0000 | [diff] [blame] | 49 | |
commit-bot@chromium.org | 6a106ce | 2014-05-20 19:02:55 +0000 | [diff] [blame] | 50 | # As of M35, Chrome requires SSE2 on x86 (and SSSE3 on Mac). |
| 51 | [ 'skia_arch_type == "x86"', { |
| 52 | 'cflags': [ |
| 53 | '-msse2', |
| 54 | '-mfpmath=sse', |
| 55 | ], |
| 56 | }], |
| 57 | |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 58 | [ 'skia_os == "win"', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 59 | { |
| 60 | 'defines': [ |
bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 61 | '_CRT_SECURE_NO_WARNINGS', |
bungeman | b7069e9 | 2015-07-21 14:14:30 -0700 | [diff] [blame] | 62 | '_HAS_EXCEPTIONS=0', |
egdaniel | 5dfe7bb | 2016-06-10 06:42:45 -0700 | [diff] [blame] | 63 | 'WIN32_LEAN_AND_MEAN', |
| 64 | 'NOMINMAX', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 65 | ], |
commit-bot@chromium.org | 50ca12b | 2014-05-07 19:56:27 +0000 | [diff] [blame] | 66 | 'msvs_disabled_warnings': [ |
bungeman | f548444 | 2014-09-10 07:49:05 -0700 | [diff] [blame] | 67 | 4275, # An exported class was derived from a class that was not exported |
| 68 | 4345, # This is an FYI about a behavior change from long ago. Chrome stifles it too. |
| 69 | 4355, # 'this' used in base member initializer list. Off by default in newer compilers. |
commit-bot@chromium.org | 50ca12b | 2014-05-07 19:56:27 +0000 | [diff] [blame] | 70 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 71 | 'msvs_cygwin_shell': 0, |
| 72 | 'msvs_settings': { |
| 73 | 'VCCLCompilerTool': { |
bsalomon@google.com | b58a639 | 2013-03-21 20:29:05 +0000 | [diff] [blame] | 74 | 'WarningLevel': '3', |
| 75 | 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 76 | 'DebugInformationFormat': '3', |
bsalomon@google.com | b58a639 | 2013-03-21 20:29:05 +0000 | [diff] [blame] | 77 | 'ExceptionHandling': '0', |
| 78 | 'AdditionalOptions': [ '/MP', ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 79 | }, |
| 80 | 'VCLinkerTool': { |
commit-bot@chromium.org | 4521add | 2014-04-30 20:47:22 +0000 | [diff] [blame] | 81 | 'LargeAddressAware': 2, # 2 means "Yes, please let me use more RAM on 32-bit builds." |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 82 | 'AdditionalDependencies': [ |
| 83 | 'OpenGL32.lib', |
| 84 | 'usp10.lib', |
bungeman@google.com | f51e125 | 2013-06-05 18:35:22 +0000 | [diff] [blame] | 85 | |
| 86 | # Prior to gyp r1584, the following were included automatically. |
| 87 | 'kernel32.lib', |
| 88 | 'gdi32.lib', |
| 89 | 'winspool.lib', |
| 90 | 'comdlg32.lib', |
| 91 | 'advapi32.lib', |
| 92 | 'shell32.lib', |
| 93 | 'ole32.lib', |
| 94 | 'oleaut32.lib', |
| 95 | 'user32.lib', |
| 96 | 'uuid.lib', |
| 97 | 'odbc32.lib', |
| 98 | 'odbccp32.lib', |
bsalomon@google.com | bbba784 | 2013-06-06 18:34:13 +0000 | [diff] [blame] | 99 | 'DelayImp.lib', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 100 | ], |
| 101 | }, |
| 102 | }, |
| 103 | 'configurations': { |
| 104 | 'Debug': { |
| 105 | 'msvs_settings': { |
| 106 | 'VCCLCompilerTool': { |
bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 107 | 'DebugInformationFormat': '4', # editAndContiue (/ZI) |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 108 | 'Optimization': '0', # optimizeDisabled (/Od) |
| 109 | 'PreprocessorDefinitions': ['_DEBUG'], |
| 110 | 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd) |
bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 111 | 'RuntimeTypeInfo': 'false', # /GR- |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 112 | }, |
| 113 | 'VCLinkerTool': { |
bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 114 | 'GenerateDebugInformation': 'true', # /DEBUG |
| 115 | 'LinkIncremental': '2', # /INCREMENTAL |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 116 | }, |
| 117 | }, |
| 118 | }, |
| 119 | 'Release': { |
| 120 | 'msvs_settings': { |
| 121 | 'VCCLCompilerTool': { |
bsalomon@google.com | 9aabfc7 | 2012-05-31 14:12:46 +0000 | [diff] [blame] | 122 | 'DebugInformationFormat': '3', # programDatabase (/Zi) |
commit-bot@chromium.org | 06b3864 | 2013-06-20 20:28:54 +0000 | [diff] [blame] | 123 | 'Optimization': '<(skia_release_optimization_level)', |
bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 124 | # Changing the floating point model requires rebaseling gm images |
bsalomon@google.com | 9aabfc7 | 2012-05-31 14:12:46 +0000 | [diff] [blame] | 125 | #'FloatingPointModel': '2', # fast (/fp:fast) |
| 126 | 'FavorSizeOrSpeed': '1', # speed (/Ot) |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 127 | 'PreprocessorDefinitions': ['NDEBUG'], |
bsalomon@google.com | 9aabfc7 | 2012-05-31 14:12:46 +0000 | [diff] [blame] | 128 | 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD) |
bsalomon@google.com | 9aabfc7 | 2012-05-31 14:12:46 +0000 | [diff] [blame] | 129 | 'EnableEnhancedInstructionSet': '2',# /arch:SSE2 |
| 130 | 'RuntimeTypeInfo': 'false', # /GR- |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 131 | }, |
| 132 | 'VCLinkerTool': { |
bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 133 | 'GenerateDebugInformation': 'true', # /DEBUG |
bungeman@google.com | 983297e | 2011-10-03 19:36:51 +0000 | [diff] [blame] | 134 | }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 135 | }, |
| 136 | }, |
commit-bot@chromium.org | d10ec40 | 2014-04-22 20:05:35 +0000 | [diff] [blame] | 137 | }, |
| 138 | 'conditions' : [ |
epoger@google.com | 58d69d8 | 2014-04-01 07:02:41 +0000 | [diff] [blame] | 139 | # Gyp's ninja generator depends on these specially named |
| 140 | # configurations to build 64-bit on Windows. |
halcanary | 6950de6 | 2015-11-07 05:29:00 -0800 | [diff] [blame] | 141 | # See https://bug.skia.org/2348 |
epoger@google.com | 58d69d8 | 2014-04-01 07:02:41 +0000 | [diff] [blame] | 142 | # |
| 143 | # We handle the 64- vs 32-bit variations elsewhere, so I think it's |
| 144 | # OK for us to just make these inherit non-archwidth-specific |
| 145 | # configurations without modification. |
commit-bot@chromium.org | d10ec40 | 2014-04-22 20:05:35 +0000 | [diff] [blame] | 146 | # |
halcanary | 6950de6 | 2015-11-07 05:29:00 -0800 | [diff] [blame] | 147 | # See https://bug.skia.org/2442 : These targets cause problems in the |
commit-bot@chromium.org | d10ec40 | 2014-04-22 20:05:35 +0000 | [diff] [blame] | 148 | # MSVS build, so only include them if gyp is generating a ninja build. |
| 149 | [ '"ninja" in "<!(echo %GYP_GENERATORS%)"', { |
| 150 | 'configurations': { |
| 151 | 'Debug_x64': { |
| 152 | 'inherit_from': ['Debug'], |
bsalomon | 6740feb | 2014-11-13 13:47:06 -0800 | [diff] [blame] | 153 | 'msvs_settings': { |
| 154 | 'VCCLCompilerTool': { |
| 155 | # /ZI is not supported on 64bit |
| 156 | 'DebugInformationFormat': '3', # programDatabase (/Zi) |
| 157 | }, |
| 158 | }, |
commit-bot@chromium.org | d10ec40 | 2014-04-22 20:05:35 +0000 | [diff] [blame] | 159 | }, |
| 160 | 'Release_x64': { |
| 161 | 'inherit_from': ['Release'], |
bsalomon | 26bdfcb | 2014-11-19 08:59:58 -0800 | [diff] [blame] | 162 | 'msvs_settings': { |
| 163 | 'VCCLCompilerTool': { |
| 164 | # Don't specify /arch. SSE2 is implied by 64bit and specifying it warns. |
| 165 | 'EnableEnhancedInstructionSet': '0', # |
| 166 | }, |
| 167 | }, |
commit-bot@chromium.org | d10ec40 | 2014-04-22 20:05:35 +0000 | [diff] [blame] | 168 | }, |
| 169 | 'Release_Developer_x64': { |
| 170 | 'inherit_from': ['Release_Developer'], |
bsalomon | 26bdfcb | 2014-11-19 08:59:58 -0800 | [diff] [blame] | 171 | 'msvs_settings': { |
| 172 | 'VCCLCompilerTool': { |
| 173 | # Don't specify /arch. SSE2 is implied by 64bit and specifying it warns. |
| 174 | 'EnableEnhancedInstructionSet': '0', # |
| 175 | }, |
| 176 | }, |
commit-bot@chromium.org | d10ec40 | 2014-04-22 20:05:35 +0000 | [diff] [blame] | 177 | }, |
| 178 | }, |
| 179 | }], |
Brian Salomon | 4239fc2 | 2015-07-27 09:10:36 -0400 | [diff] [blame] | 180 | [ 'skia_arch_type == "x86_64"', { |
bsalomon@google.com | 1d03ba9 | 2013-01-08 20:40:22 +0000 | [diff] [blame] | 181 | 'msvs_configuration_platform': 'x64', |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 182 | }], |
Brian Salomon | 4239fc2 | 2015-07-27 09:10:36 -0400 | [diff] [blame] | 183 | [ 'skia_arch_type == "x86"', { |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 184 | 'msvs_configuration_platform': 'Win32', |
| 185 | }], |
| 186 | [ 'skia_warnings_as_errors', { |
bsalomon@google.com | 1d03ba9 | 2013-01-08 20:40:22 +0000 | [diff] [blame] | 187 | 'msvs_settings': { |
| 188 | 'VCCLCompilerTool': { |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 189 | 'WarnAsError': 'true', |
| 190 | 'AdditionalOptions': [ |
| 191 | '/we4189', # initialized but unused var warning |
bungeman | 918090c | 2016-02-09 09:14:28 -0800 | [diff] [blame] | 192 | '/we4238', # taking address of rvalue |
| 193 | '/we4239', # assigning rvalues to non-const lvalues |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 194 | ], |
bsalomon@google.com | 1d03ba9 | 2013-01-08 20:40:22 +0000 | [diff] [blame] | 195 | }, |
| 196 | }, |
borenet@google.com | b796119 | 2012-08-20 18:58:26 +0000 | [diff] [blame] | 197 | }], |
commit-bot@chromium.org | 5a6c2d8 | 2013-06-14 17:10:09 +0000 | [diff] [blame] | 198 | [ 'skia_win_exceptions', { |
| 199 | 'msvs_settings': { |
| 200 | 'VCCLCompilerTool': { |
| 201 | 'AdditionalOptions': [ |
| 202 | '/EHsc', |
| 203 | ], |
| 204 | }, |
| 205 | }, |
| 206 | }], |
bsalomon | da07a08 | 2014-06-26 12:56:28 -0700 | [diff] [blame] | 207 | [ 'skia_win_ltcg', { |
| 208 | 'configurations': { |
| 209 | 'Release': { |
| 210 | 'msvs_settings': { |
| 211 | 'VCCLCompilerTool': { |
| 212 | 'WholeProgramOptimization': 'true', #/GL |
| 213 | }, |
| 214 | 'VCLinkerTool': { |
| 215 | 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG |
| 216 | }, |
| 217 | 'VCLibrarianTool': { |
| 218 | 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG |
| 219 | }, |
| 220 | }, |
| 221 | }, |
| 222 | }, |
| 223 | }], |
borenet@google.com | b796119 | 2012-08-20 18:58:26 +0000 | [diff] [blame] | 224 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 225 | }, |
| 226 | ], |
| 227 | |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 228 | # The following section is common to linux + derivatives and android |
borenet | 43bf511 | 2016-04-29 14:01:34 -0700 | [diff] [blame] | 229 | [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "android"]', |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 230 | { |
mtklein@google.com | f1077f9 | 2013-11-20 15:13:49 +0000 | [diff] [blame] | 231 | 'cflags': [ |
mtklein@google.com | dad7070 | 2013-11-20 18:06:10 +0000 | [diff] [blame] | 232 | '-g', |
mtklein@google.com | f1077f9 | 2013-11-20 15:13:49 +0000 | [diff] [blame] | 233 | '-fno-exceptions', |
| 234 | '-fstrict-aliasing', |
mtklein@google.com | dad7070 | 2013-11-20 18:06:10 +0000 | [diff] [blame] | 235 | |
mtklein@google.com | f1077f9 | 2013-11-20 15:13:49 +0000 | [diff] [blame] | 236 | '-Wall', |
| 237 | '-Wextra', |
| 238 | '-Winit-self', |
| 239 | '-Wpointer-arith', |
mtklein | a07b297 | 2015-01-23 07:01:26 -0800 | [diff] [blame] | 240 | '-Wsign-compare', |
dvonbeck | 115e925 | 2016-06-15 09:13:50 -0700 | [diff] [blame] | 241 | '-Wvla', |
mtklein@google.com | f1077f9 | 2013-11-20 15:13:49 +0000 | [diff] [blame] | 242 | |
| 243 | '-Wno-unused-parameter', |
mtklein@google.com | f1077f9 | 2013-11-20 15:13:49 +0000 | [diff] [blame] | 244 | ], |
| 245 | 'cflags_cc': [ |
mtklein | f3cdce7 | 2015-02-05 09:23:56 -0800 | [diff] [blame] | 246 | '-std=c++11', |
mtklein@google.com | f1077f9 | 2013-11-20 15:13:49 +0000 | [diff] [blame] | 247 | '-fno-rtti', |
mtklein | 61a81e3 | 2015-09-09 10:46:20 -0700 | [diff] [blame] | 248 | '-fno-threadsafe-statics', |
mtklein@google.com | f1077f9 | 2013-11-20 15:13:49 +0000 | [diff] [blame] | 249 | '-Wnon-virtual-dtor', |
| 250 | ], |
mtklein | 673748a | 2016-03-07 11:05:15 -0800 | [diff] [blame] | 251 | 'ldflags': [ '-rdynamic' ], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 252 | 'conditions': [ |
mtklein | dee3df9 | 2015-03-26 05:30:44 -0700 | [diff] [blame] | 253 | [ 'skia_fast', { 'cflags': [ '<@(skia_fast_flags)' ] }], |
borenet | 43bf511 | 2016-04-29 14:01:34 -0700 | [diff] [blame] | 254 | [ 'skia_arch_type == "x86_64" and not skia_android_framework', { |
| 255 | 'cflags': [ |
| 256 | '-m64', |
| 257 | ], |
| 258 | 'ldflags': [ |
| 259 | '-m64', |
| 260 | ], |
| 261 | }], |
| 262 | [ 'skia_arch_type == "x86" and not skia_android_framework', { |
| 263 | 'cflags': [ |
| 264 | '-m32', |
| 265 | ], |
| 266 | 'ldflags': [ |
| 267 | '-m32', |
qiankun.miao | d312a04 | 2014-07-07 09:47:24 -0700 | [diff] [blame] | 268 | ], |
| 269 | }], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 270 | [ 'skia_warnings_as_errors', { |
| 271 | 'cflags': [ |
| 272 | '-Werror', |
| 273 | ], |
| 274 | }], |
commit-bot@chromium.org | 35d4872 | 2014-02-13 18:36:36 +0000 | [diff] [blame] | 275 | # For profiling; reveals some costs, exaggerates others (e.g. trivial setters & getters). |
| 276 | [ 'skia_disable_inlining', { |
| 277 | 'cflags': [ |
| 278 | '-fno-inline', |
| 279 | '-fno-default-inline', |
| 280 | '-finline-limit=0', |
| 281 | '-fno-omit-frame-pointer', |
| 282 | ], |
| 283 | }], |
djsollen@google.com | f7542ba | 2013-07-31 12:57:27 +0000 | [diff] [blame] | 284 | [ 'skia_arch_type == "arm" and arm_version >= 7', { |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 285 | 'cflags': [ |
| 286 | '-march=armv7-a', |
mtklein | 2d33a1d | 2015-04-02 10:47:57 -0700 | [diff] [blame] | 287 | '-mthumb', |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 288 | ], |
djsollen@google.com | f7542ba | 2013-07-31 12:57:27 +0000 | [diff] [blame] | 289 | 'ldflags': [ |
| 290 | '-march=armv7-a', |
| 291 | ], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 292 | 'conditions': [ |
| 293 | [ 'arm_neon == 1', { |
| 294 | 'defines': [ |
djsollen | 21769c5 | 2014-08-01 05:32:32 -0700 | [diff] [blame] | 295 | 'SK_ARM_HAS_NEON', |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 296 | ], |
| 297 | 'cflags': [ |
| 298 | '-mfpu=neon', |
| 299 | ], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 300 | }], |
borenet | 43bf511 | 2016-04-29 14:01:34 -0700 | [diff] [blame] | 301 | [ 'skia_os != "linux"', { |
borenet@google.com | e2b9037 | 2013-07-11 18:46:30 +0000 | [diff] [blame] | 302 | 'cflags': [ |
| 303 | '-mfloat-abi=softfp', |
| 304 | ], |
| 305 | }], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 306 | ], |
| 307 | }], |
Brian Salomon | 4239fc2 | 2015-07-27 09:10:36 -0400 | [diff] [blame] | 308 | [ '"mips" in skia_arch_type', { |
milko.leporis | 401e77c | 2016-06-05 13:14:21 -0700 | [diff] [blame] | 309 | 'target_conditions': [ |
| 310 | [ '_toolset == "target"', { |
| 311 | 'cflags' : ['-EL'], |
| 312 | 'conditions' : [ |
| 313 | [ 'mips_arch_variant == "mips32r2"', { |
| 314 | 'cflags': [ '-march=mips32r2' ], |
| 315 | 'conditions': [ |
| 316 | [ 'mips_dsp == 1', { 'cflags': [ '-mdsp' ] }], |
| 317 | [ 'mips_dsp == 2', { 'cflags': [ '-mdspr2' ] }], |
| 318 | ], |
| 319 | }], |
djordje.pesut | aaf1df6 | 2014-06-06 14:09:12 -0700 | [diff] [blame] | 320 | ], |
| 321 | }], |
| 322 | ], |
| 323 | }], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 324 | ], |
| 325 | }, |
| 326 | ], |
| 327 | |
scroggo@google.com | d4adfa3 | 2014-02-05 16:35:12 +0000 | [diff] [blame] | 328 | ['skia_android_framework', { |
| 329 | 'cflags': [ |
| 330 | # Skia does not enforce this usage pattern so we disable it here to avoid |
| 331 | # unecessary log spew when building |
| 332 | '-Wno-unused-parameter', |
| 333 | |
| 334 | # Android's -D_FORTIFY_SOURCE=2 extensions are incompatibile with SkString. |
| 335 | # Revert to -D_FORTIFY_SOURCE=1 |
| 336 | '-U_FORTIFY_SOURCE', |
| 337 | '-D_FORTIFY_SOURCE=1', |
djsollen | f379ad3 | 2015-01-27 09:01:01 -0800 | [diff] [blame] | 338 | |
mtklein | 9a106ba | 2015-08-14 10:03:45 -0700 | [diff] [blame] | 339 | # We can't use the skia_shared_lib gyp setting because we need to |
djsollen | f379ad3 | 2015-01-27 09:01:01 -0800 | [diff] [blame] | 340 | # isolate this define to Skia sources. CFLAGS are local to Android.mk |
| 341 | # and ensures that this define is not exported to clients of the library |
| 342 | '-DSKIA_IMPLEMENTATION=1', |
scroggo@google.com | d4adfa3 | 2014-02-05 16:35:12 +0000 | [diff] [blame] | 343 | ], |
commit-bot@chromium.org | 2fe641b | 2014-03-25 15:14:18 +0000 | [diff] [blame] | 344 | # Remove flags which are either unnecessary or problematic for the |
| 345 | # Android framework build. Many of these flags are removed simply because |
| 346 | # they were not previously in the Android framework makefile, and we did |
| 347 | # did not intend to add them when generating the makefile. |
| 348 | # TODO (scroggo): Investigate whether any of these flags are actually |
| 349 | # needed/would be beneficial. |
commit-bot@chromium.org | e72a408 | 2014-02-28 16:07:39 +0000 | [diff] [blame] | 350 | 'cflags!': [ |
commit-bot@chromium.org | 2fe641b | 2014-03-25 15:14:18 +0000 | [diff] [blame] | 351 | # Android has one makefile, used for both debugging (after manual |
| 352 | # modification) and release. Turn off debug info by default. |
commit-bot@chromium.org | e72a408 | 2014-02-28 16:07:39 +0000 | [diff] [blame] | 353 | '-g', |
| 354 | '-march=armv7-a', |
| 355 | '-mthumb', |
| 356 | '-mfpu=neon', |
| 357 | '-mfloat-abi=softfp', |
commit-bot@chromium.org | 2fe641b | 2014-03-25 15:14:18 +0000 | [diff] [blame] | 358 | '-fno-exceptions', |
| 359 | '-fstrict-aliasing', |
| 360 | # Remove flags to turn on warnings, since most people building Android |
| 361 | # are not focused on Skia and do not need the extra warning info. |
| 362 | '-Wall', |
| 363 | '-Wextra', |
| 364 | '-Winit-self', |
| 365 | '-Wpointer-arith', |
mtklein | a07b297 | 2015-01-23 07:01:26 -0800 | [diff] [blame] | 366 | '-Wsign-compare', |
commit-bot@chromium.org | 2fe641b | 2014-03-25 15:14:18 +0000 | [diff] [blame] | 367 | ], |
| 368 | 'cflags_cc!': [ |
| 369 | '-fno-rtti', |
| 370 | '-Wnon-virtual-dtor', |
commit-bot@chromium.org | e72a408 | 2014-02-28 16:07:39 +0000 | [diff] [blame] | 371 | ], |
scroggo@google.com | d4adfa3 | 2014-02-05 16:35:12 +0000 | [diff] [blame] | 372 | 'defines': [ |
| 373 | 'DCT_IFAST_SUPPORTED', |
| 374 | # using freetype's embolden allows us to adjust fake bold settings at |
| 375 | # draw-time, at which point we know which SkTypeface is being drawn |
| 376 | 'SK_USE_FREETYPE_EMBOLDEN', |
commit-bot@chromium.org | ba0c5ea | 2014-03-28 15:59:04 +0000 | [diff] [blame] | 377 | # When built as part of the system image we can enable certian non-NDK |
| 378 | # compliant optimizations. |
| 379 | 'SK_BUILD_FOR_ANDROID_FRAMEWORK', |
commit-bot@chromium.org | ba0c5ea | 2014-03-28 15:59:04 +0000 | [diff] [blame] | 380 | # Optimizations for chromium (m30) |
| 381 | 'GR_GL_CUSTOM_SETUP_HEADER "gl/GrGLConfig_chrome.h"', |
commit-bot@chromium.org | ba0c5ea | 2014-03-28 15:59:04 +0000 | [diff] [blame] | 382 | 'SK_DEFAULT_FONT_CACHE_LIMIT (768 * 1024)', |
commit-bot@chromium.org | e3c400f | 2014-05-28 21:44:05 +0000 | [diff] [blame] | 383 | 'SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)', |
krajcevski | 8c111f7 | 2014-06-02 13:51:34 -0700 | [diff] [blame] | 384 | 'SK_IGNORE_ETC1_SUPPORT', |
mtklein | 9a106ba | 2015-08-14 10:03:45 -0700 | [diff] [blame] | 385 | # We can't use the skia_shared_lib gyp setting because we need expose |
djsollen | f379ad3 | 2015-01-27 09:01:01 -0800 | [diff] [blame] | 386 | # this define globally and the the implemention define as a cflag. |
| 387 | 'SKIA_DLL', |
scroggo | 230d4ac | 2015-03-26 07:15:55 -0700 | [diff] [blame] | 388 | 'SK_PRINT_CODEC_MESSAGES', |
borenet | 243406e | 2015-07-22 13:29:25 -0700 | [diff] [blame] | 389 | ], |
| 390 | }], |
| 391 | |
| 392 | ['skia_use_android_framework_defines', { |
| 393 | # Add these defines when building for the Android framework, or when |
| 394 | # specifically requested. These should be temporary staging defines. Any |
| 395 | # permanent defines should be moved into the skia_android_framework block |
| 396 | # above. |
borenet | 243406e | 2015-07-22 13:29:25 -0700 | [diff] [blame] | 397 | 'defines': [ |
Mike Klein | cfc4f44 | 2016-10-26 17:19:03 -0400 | [diff] [blame] | 398 | '<!@(python read_gni.py ../gn/android_framework_defines.gni android_framework_defines)' |
scroggo@google.com | d4adfa3 | 2014-02-05 16:35:12 +0000 | [diff] [blame] | 399 | ], |
| 400 | }], |
mtklein | d7b25c7 | 2015-11-12 08:41:40 -0800 | [diff] [blame] | 401 | |
joshualitt | 47fdae9 | 2015-11-09 12:30:05 -0800 | [diff] [blame] | 402 | [ 'skia_use_sdl == 1', |
| 403 | { |
| 404 | 'defines': [ 'SK_USE_SDL' ], |
| 405 | }], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 406 | |
joshualitt | f16f88b | 2015-12-02 13:00:37 -0800 | [diff] [blame] | 407 | [ 'skia_dump_stats == 1', |
| 408 | { |
| 409 | 'defines': [ 'SK_DUMP_STATS'], |
| 410 | }], |
| 411 | |
borenet | 43bf511 | 2016-04-29 14:01:34 -0700 | [diff] [blame] | 412 | [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 413 | { |
| 414 | 'defines': [ |
| 415 | 'SK_SAMPLES_FOR_X', |
| 416 | 'SK_BUILD_FOR_UNIX', |
| 417 | ], |
| 418 | 'configurations': { |
mtklein@google.com | 1fb04e2 | 2013-09-13 19:32:43 +0000 | [diff] [blame] | 419 | 'Coverage': { |
borenet | 11271fe | 2015-07-06 07:43:58 -0700 | [diff] [blame] | 420 | 'conditions': [ |
| 421 | [ 'skia_clang_build', { |
| 422 | 'cflags': ['-fprofile-instr-generate', '-fcoverage-mapping'], |
| 423 | 'ldflags': ['-fprofile-instr-generate', '-fcoverage-mapping'], |
| 424 | }, { |
| 425 | 'cflags': ['--coverage'], |
| 426 | 'ldflags': ['--coverage'], |
| 427 | }], |
| 428 | ], |
mtklein@google.com | 1fb04e2 | 2013-09-13 19:32:43 +0000 | [diff] [blame] | 429 | }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 430 | 'Debug': { |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 431 | }, |
| 432 | 'Release': { |
commit-bot@chromium.org | 06b3864 | 2013-06-20 20:28:54 +0000 | [diff] [blame] | 433 | 'cflags': [ |
| 434 | '-O<(skia_release_optimization_level)', |
commit-bot@chromium.org | 06b3864 | 2013-06-20 20:28:54 +0000 | [diff] [blame] | 435 | ], |
senorblanco@chromium.org | 7288c49 | 2012-01-19 19:59:22 +0000 | [diff] [blame] | 436 | 'defines': [ 'NDEBUG' ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 437 | }, |
| 438 | }, |
borenet@google.com | a37a517 | 2012-08-09 20:44:32 +0000 | [diff] [blame] | 439 | 'conditions' : [ |
zachr@google.com | 28c27c8 | 2013-06-20 17:15:05 +0000 | [diff] [blame] | 440 | [ 'skia_shared_lib', { |
zachr@google.com | 28c27c8 | 2013-06-20 17:15:05 +0000 | [diff] [blame] | 441 | 'defines': [ |
zachr@google.com | 28c27c8 | 2013-06-20 17:15:05 +0000 | [diff] [blame] | 442 | 'SKIA_DLL', |
| 443 | 'SKIA_IMPLEMENTATION=1', |
| 444 | ], |
| 445 | }], |
mtklein@google.com | 9f3b0e4 | 2013-10-08 15:16:36 +0000 | [diff] [blame] | 446 | # Enable asan, tsan, etc. |
| 447 | [ 'skia_sanitizer', { |
mtklein | 632199e | 2015-12-09 12:39:01 -0800 | [diff] [blame] | 448 | 'cflags_cc!': [ '-fno-rtti' ], # vptr needs rtti |
borenet@google.com | 0d19309 | 2013-07-03 15:55:05 +0000 | [diff] [blame] | 449 | 'cflags': [ |
mtklein | bb5b77d | 2015-12-08 14:26:17 -0800 | [diff] [blame] | 450 | '-fsanitize=<(skia_sanitizer)', # Turn on sanitizers. |
| 451 | '-fno-sanitize-recover=<(skia_sanitizer)', # Make any failure fatal. |
| 452 | '-fsanitize-blacklist=<(skia_sanitizer_blacklist)', # Compile in our blacklist. |
| 453 | '-include <(skia_sanitizer_blacklist)', # Make every .cpp depend on it. |
borenet@google.com | 0d19309 | 2013-07-03 15:55:05 +0000 | [diff] [blame] | 454 | ], |
mtklein | 632199e | 2015-12-09 12:39:01 -0800 | [diff] [blame] | 455 | 'ldflags': [ '-fsanitize=<(skia_sanitizer)' ], |
mtklein@google.com | 3a19fb5 | 2013-10-09 16:12:23 +0000 | [diff] [blame] | 456 | 'conditions' : [ |
mtklein | e721a8e | 2016-02-06 19:12:23 -0800 | [diff] [blame] | 457 | [ 'skia_sanitizer == "memory"', { |
mtklein | a861c00 | 2016-02-07 09:12:29 -0800 | [diff] [blame] | 458 | 'cflags': [ |
| 459 | '-O1', |
| 460 | '-fsanitize-memory-track-origins', |
| 461 | ], |
mtklein | e721a8e | 2016-02-06 19:12:23 -0800 | [diff] [blame] | 462 | }], |
mtklein@google.com | 3a19fb5 | 2013-10-09 16:12:23 +0000 | [diff] [blame] | 463 | ], |
bungeman@google.com | 1435f9f | 2013-09-25 22:39:22 +0000 | [diff] [blame] | 464 | }], |
borenet@google.com | 47ae4b0 | 2013-08-21 18:02:50 +0000 | [diff] [blame] | 465 | [ 'skia_clang_build', { |
mtklein | 170e00d | 2014-06-30 12:33:11 -0700 | [diff] [blame] | 466 | 'cflags_cc': [ |
mtklein | 170e00d | 2014-06-30 12:33:11 -0700 | [diff] [blame] | 467 | '-Wno-unknown-warning-option', # Allows unknown warnings. |
| 468 | '-Wno-deprecated', # From Qt, via debugger (older Clang). |
| 469 | '-Wno-deprecated-register', # From Qt, via debugger (newer Clang). |
| 470 | ], |
borenet@google.com | 47ae4b0 | 2013-08-21 18:02:50 +0000 | [diff] [blame] | 471 | 'cflags': [ |
mtklein | 170e00d | 2014-06-30 12:33:11 -0700 | [diff] [blame] | 472 | # Extra warnings we like but that only Clang knows about. |
| 473 | '-Wstring-conversion', |
borenet@google.com | 47ae4b0 | 2013-08-21 18:02:50 +0000 | [diff] [blame] | 474 | ], |
commit-bot@chromium.org | 815d360 | 2014-05-20 19:42:03 +0000 | [diff] [blame] | 475 | 'cflags!': [ |
| 476 | '-mfpmath=sse', # Clang doesn't need to be told this, and sometimes gets confused. |
| 477 | ], |
borenet@google.com | 47ae4b0 | 2013-08-21 18:02:50 +0000 | [diff] [blame] | 478 | }], |
commit-bot@chromium.org | 5003bde | 2013-10-25 18:14:54 +0000 | [diff] [blame] | 479 | [ 'skia_keep_frame_pointer', { |
| 480 | 'cflags': [ '-fno-omit-frame-pointer' ], |
| 481 | }], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 482 | ], |
| 483 | }, |
| 484 | ], |
| 485 | |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 486 | [ 'skia_os == "mac"', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 487 | { |
mtklein | a34633f | 2014-08-19 13:32:59 -0700 | [diff] [blame] | 488 | 'defines': [ 'SK_BUILD_FOR_MAC' ], |
hendrikw | 9a74041 | 2015-10-28 08:42:29 -0700 | [diff] [blame] | 489 | 'conditions': [ |
| 490 | # ANGLE for mac hits -Wunneeded-internal-declaration if this isn't set. |
| 491 | [ 'skia_angle', { 'defines': [ 'YY_NO_INPUT' ], } ], |
| 492 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 493 | 'configurations': { |
commit-bot@chromium.org | 866f4e3 | 2013-11-21 17:04:29 +0000 | [diff] [blame] | 494 | 'Coverage': { |
| 495 | 'xcode_settings': { |
| 496 | 'GCC_OPTIMIZATION_LEVEL': '0', |
| 497 | 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', |
| 498 | 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS' : 'YES', |
| 499 | }, |
| 500 | }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 501 | 'Debug': { |
mtklein | a34633f | 2014-08-19 13:32:59 -0700 | [diff] [blame] | 502 | 'xcode_settings': { 'GCC_OPTIMIZATION_LEVEL': '0' }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 503 | }, |
reed@google.com | e05cc8e | 2011-10-10 14:19:40 +0000 | [diff] [blame] | 504 | 'Release': { |
mtklein | a34633f | 2014-08-19 13:32:59 -0700 | [diff] [blame] | 505 | 'xcode_settings': { 'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)', }, |
senorblanco@chromium.org | 7288c49 | 2012-01-19 19:59:22 +0000 | [diff] [blame] | 506 | 'defines': [ 'NDEBUG' ], |
reed@google.com | e05cc8e | 2011-10-10 14:19:40 +0000 | [diff] [blame] | 507 | }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 508 | }, |
| 509 | 'xcode_settings': { |
senorblanco@chromium.org | 29f351a | 2014-01-20 16:14:02 +0000 | [diff] [blame] | 510 | 'conditions': [ |
mtklein | dee3df9 | 2015-03-26 05:30:44 -0700 | [diff] [blame] | 511 | [ 'skia_fast', { 'WARNING_CFLAGS': [ '<@(skia_fast_flags)' ] } ], |
mtklein | a34633f | 2014-08-19 13:32:59 -0700 | [diff] [blame] | 512 | [ 'skia_warnings_as_errors', { 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES' }], |
Brian Salomon | 4239fc2 | 2015-07-27 09:10:36 -0400 | [diff] [blame] | 513 | [ 'skia_arch_type == "x86"', { 'ARCHS': ['i386'] }], |
| 514 | [ 'skia_arch_type == "x86_64"', { 'ARCHS': ['x86_64'] }], |
senorblanco@chromium.org | 29f351a | 2014-01-20 16:14:02 +0000 | [diff] [blame] | 515 | [ 'skia_osx_deployment_target==""', { |
mtklein | d7b25c7 | 2015-11-12 08:41:40 -0800 | [diff] [blame] | 516 | 'MACOSX_DEPLOYMENT_TARGET': '10.7', # -mmacos-version-min, passed in env to ld. |
senorblanco@chromium.org | 29f351a | 2014-01-20 16:14:02 +0000 | [diff] [blame] | 517 | }, { |
| 518 | 'MACOSX_DEPLOYMENT_TARGET': '<(skia_osx_deployment_target)', |
| 519 | }], |
mtklein | 632199e | 2015-12-09 12:39:01 -0800 | [diff] [blame] | 520 | [ 'skia_sanitizer', { |
bungeman | 1aeac30 | 2016-02-03 13:06:28 -0800 | [diff] [blame] | 521 | 'GCC_ENABLE_CPP_RTTI': 'YES', # vptr needs rtti |
mtklein | 632199e | 2015-12-09 12:39:01 -0800 | [diff] [blame] | 522 | 'OTHER_CFLAGS': [ |
| 523 | '-fsanitize=<(skia_sanitizer)', # Turn on sanitizers. |
| 524 | '-fno-sanitize-recover=<(skia_sanitizer)', # Make any failure fatal. |
| 525 | '-fsanitize-blacklist=<(skia_sanitizer_blacklist)', # Compile in our blacklist. |
| 526 | '-include <(skia_sanitizer_blacklist)', # Make every .cpp depend on it. |
| 527 | ], |
| 528 | # We want to pass -fsanitize=... to our final link call, |
| 529 | # but not to libtool. OTHER_LDFLAGS is passed to both. |
| 530 | # To trick GYP into doing what we want, we'll piggyback on |
| 531 | # LIBRARY_SEARCH_PATHS, producing "-L/usr/lib -fsanitize=...". |
| 532 | # The -L/usr/lib is redundant but innocuous: it's a default path. |
| 533 | 'LIBRARY_SEARCH_PATHS': [ '/usr/lib -fsanitize=<(skia_sanitizer)'], |
| 534 | }], |
senorblanco@chromium.org | 29f351a | 2014-01-20 16:14:02 +0000 | [diff] [blame] | 535 | ], |
mtklein | d7b25c7 | 2015-11-12 08:41:40 -0800 | [diff] [blame] | 536 | 'CLANG_CXX_LIBRARY': 'libc++', |
bungeman | 1aeac30 | 2016-02-03 13:06:28 -0800 | [diff] [blame] | 537 | 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', |
| 538 | 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions |
| 539 | 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti |
| 540 | 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics |
| 541 | 'GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS': 'YES', # -mssse3 |
mtklein | 02b2f19 | 2016-03-28 12:43:39 -0700 | [diff] [blame] | 542 | 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden |
| 543 | 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', # -fvisibility-inlines-hidden |
mtklein | 335a0ae | 2014-10-13 12:32:34 -0700 | [diff] [blame] | 544 | 'GCC_CW_ASM_SYNTAX': 'NO', # remove -fasm-blocks |
| 545 | 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # remove -mpascal-strings |
bungeman | 1aeac30 | 2016-02-03 13:06:28 -0800 | [diff] [blame] | 546 | 'WARNING_CFLAGS': [ |
| 547 | '-Wall', |
| 548 | '-Wextra', |
| 549 | '-Winit-self', |
| 550 | '-Wpointer-arith', |
| 551 | '-Wsign-compare', |
dvonbeck | 115e925 | 2016-06-15 09:13:50 -0700 | [diff] [blame] | 552 | '-Wvla', |
bungeman | 1aeac30 | 2016-02-03 13:06:28 -0800 | [diff] [blame] | 553 | |
| 554 | '-Wno-unused-parameter', |
bungeman@google.com | 43b4ed5 | 2012-10-02 15:42:21 +0000 | [diff] [blame] | 555 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 556 | }, |
| 557 | }, |
| 558 | ], |
| 559 | |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 560 | [ 'skia_os == "ios"', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 561 | { |
| 562 | 'defines': [ |
sdefresne | e3fa811 | 2016-06-01 07:08:56 -0700 | [diff] [blame] | 563 | # When targetting iOS and using gyp to generate the build files, it is |
| 564 | # not possible to select files to build depending on the architecture |
| 565 | # (i.e. it is not possible to use hand optimized assembly version). In |
| 566 | # that configuration, disable all optimisation. |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 567 | 'SK_BUILD_FOR_IOS', |
sdefresne | e3fa811 | 2016-06-01 07:08:56 -0700 | [diff] [blame] | 568 | 'SK_BUILD_NO_OPTS', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 569 | ], |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 570 | 'conditions' : [ |
| 571 | [ 'skia_warnings_as_errors', { |
| 572 | 'xcode_settings': { |
| 573 | 'OTHER_CPLUSPLUSFLAGS': [ |
| 574 | '-Werror', |
| 575 | ], |
| 576 | }, |
| 577 | }], |
| 578 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 579 | 'configurations': { |
| 580 | 'Debug': { |
| 581 | 'xcode_settings': { |
| 582 | 'GCC_OPTIMIZATION_LEVEL': '0', |
| 583 | }, |
| 584 | }, |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 585 | 'Release': { |
| 586 | 'xcode_settings': { |
commit-bot@chromium.org | 06b3864 | 2013-06-20 20:28:54 +0000 | [diff] [blame] | 587 | 'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)', |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 588 | }, |
| 589 | 'defines': [ 'NDEBUG' ], |
| 590 | }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 591 | }, |
| 592 | 'xcode_settings': { |
commit-bot@chromium.org | ae0054e | 2014-04-05 01:13:43 +0000 | [diff] [blame] | 593 | 'ARCHS': ['armv7'], |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 594 | 'CODE_SIGNING_REQUIRED': 'NO', |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 595 | 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)', |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 596 | 'SDKROOT': 'iphoneos', |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 597 | 'TARGETED_DEVICE_FAMILY': '1,2', |
mtklein | 1e5cbf2 | 2015-11-16 16:20:34 -0800 | [diff] [blame] | 598 | |
| 599 | 'CLANG_CXX_LIBRARY': 'libc++', |
| 600 | 'CLANG_CXX_LANGUAGE_STANDARD': 'c++11', |
| 601 | 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions |
| 602 | 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti |
| 603 | 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics |
mtklein | 02b2f19 | 2016-03-28 12:43:39 -0700 | [diff] [blame] | 604 | 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden |
| 605 | 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', # -fvisibility-inlines-hidden |
mtklein | 1e5cbf2 | 2015-11-16 16:20:34 -0800 | [diff] [blame] | 606 | |
| 607 | 'GCC_THUMB_SUPPORT': 'NO', # TODO(mtklein): why would we not want thumb? |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 608 | }, |
| 609 | }, |
| 610 | ], |
chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 611 | |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 612 | [ 'skia_os == "android"', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 613 | { |
| 614 | 'defines': [ |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 615 | 'SK_BUILD_FOR_ANDROID', |
djsollen@google.com | 968757e | 2014-04-11 13:09:21 +0000 | [diff] [blame] | 616 | |
mtklein | 8d7f5c3 | 2016-08-01 09:22:12 -0700 | [diff] [blame] | 617 | # Android defines a fixed text gamma exponent instead of using SRGB |
djsollen@google.com | 968757e | 2014-04-11 13:09:21 +0000 | [diff] [blame] | 618 | 'SK_GAMMA_EXPONENT=1.4', |
| 619 | 'SK_GAMMA_CONTRAST=0.0', |
| 620 | ], |
scroggo@google.com | eb62950 | 2014-02-04 16:08:48 +0000 | [diff] [blame] | 621 | 'configurations': { |
scroggo@google.com | eb62950 | 2014-02-04 16:08:48 +0000 | [diff] [blame] | 622 | 'Release': { |
| 623 | 'cflags': ['-O2'], |
djsollen | 460f405 | 2016-04-25 11:45:35 -0700 | [diff] [blame] | 624 | 'conditions': [ |
| 625 | [ 'skia_clang_build', { |
| 626 | 'cflags!': ['-g'], |
| 627 | 'cflags': [ '-gline-tables-only' ], |
| 628 | }], |
| 629 | ], |
scroggo@google.com | eb62950 | 2014-02-04 16:08:48 +0000 | [diff] [blame] | 630 | }, |
| 631 | }, |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 632 | 'libraries': [ |
djsollen@google.com | 318cf92 | 2011-11-08 19:03:43 +0000 | [diff] [blame] | 633 | '-llog', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 634 | ], |
djsollen@google.com | 44360bc | 2011-12-05 13:55:55 +0000 | [diff] [blame] | 635 | 'cflags': [ |
borenet@google.com | de9ac14 | 2012-07-25 15:17:03 +0000 | [diff] [blame] | 636 | '-fuse-ld=gold', |
djsollen@google.com | 44360bc | 2011-12-05 13:55:55 +0000 | [diff] [blame] | 637 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 638 | 'conditions': [ |
scroggo | df1c337 | 2015-02-12 10:48:25 -0800 | [diff] [blame] | 639 | [ '"x86" in skia_arch_type', { |
djsollen | bc89329 | 2014-07-24 13:53:56 -0700 | [diff] [blame] | 640 | 'cflags': [ |
| 641 | '-mssse3', |
| 642 | ], |
| 643 | }], |
scroggo@google.com | d4adfa3 | 2014-02-05 16:35:12 +0000 | [diff] [blame] | 644 | [ 'skia_android_framework', { |
commit-bot@chromium.org | 2fe641b | 2014-03-25 15:14:18 +0000 | [diff] [blame] | 645 | 'cflags!': [ |
| 646 | '-fuse-ld=gold', |
scroggo | 7cd3f64 | 2015-02-12 13:27:40 -0800 | [diff] [blame] | 647 | '-mssse3', |
commit-bot@chromium.org | 2fe641b | 2014-03-25 15:14:18 +0000 | [diff] [blame] | 648 | ], |
scroggo@google.com | d4adfa3 | 2014-02-05 16:35:12 +0000 | [diff] [blame] | 649 | }], |
djsollen@google.com | 52f0297 | 2013-06-03 12:10:19 +0000 | [diff] [blame] | 650 | [ 'skia_shared_lib', { |
djsollen@google.com | 52f0297 | 2013-06-03 12:10:19 +0000 | [diff] [blame] | 651 | 'defines': [ |
djsollen@google.com | 52f0297 | 2013-06-03 12:10:19 +0000 | [diff] [blame] | 652 | 'SKIA_DLL', |
| 653 | 'SKIA_IMPLEMENTATION=1', |
halcanary | 6950de6 | 2015-11-07 05:29:00 -0800 | [diff] [blame] | 654 | # Needed until we fix https://bug.skia.org/2440 . |
scroggo | ecce60b | 2014-07-09 07:26:40 -0700 | [diff] [blame] | 655 | 'SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG', |
djsollen@google.com | 52f0297 | 2013-06-03 12:10:19 +0000 | [diff] [blame] | 656 | ], |
| 657 | }], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 658 | [ 'skia_profile_enabled == 1', { |
| 659 | 'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'], |
djsollen@google.com | 3839ca1 | 2011-11-03 17:31:41 +0000 | [diff] [blame] | 660 | }], |
djsollen | f9deeb6 | 2016-03-07 12:30:47 -0800 | [diff] [blame] | 661 | [ 'skia_clang_build', { |
| 662 | 'cflags': [ |
| 663 | '-Wno-unknown-warning-option', # Allows unknown warnings |
| 664 | # These flags that are on by default for only the android |
| 665 | # toolchain and no other platforms. |
| 666 | '-Wno-tautological-compare', |
| 667 | '-Wno-unused-command-line-argument', |
| 668 | ], |
| 669 | }], |
chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 670 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 671 | }, |
| 672 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 673 | |
commit-bot@chromium.org | 199cf69 | 2014-05-08 15:29:57 +0000 | [diff] [blame] | 674 | [ 'skia_moz2d', { |
| 675 | 'defines': [ |
reed | 6518eaa | 2014-06-18 14:05:22 -0700 | [diff] [blame] | 676 | # add flags here (e.g. SK_SUPPORT_LEGACY_...) needed by moz2d |
commit-bot@chromium.org | 199cf69 | 2014-05-08 15:29:57 +0000 | [diff] [blame] | 677 | ], |
| 678 | }], |
| 679 | |
hendrikw | 855dc93 | 2015-10-27 10:04:34 -0700 | [diff] [blame] | 680 | [ 'skia_command_buffer and skia_os == "linux"', { |
hendrikw | b1ac52f | 2015-10-01 18:29:34 -0700 | [diff] [blame] | 681 | 'ldflags': [ |
| 682 | '-Wl,-rpath,\$$ORIGIN/lib', |
| 683 | ], |
| 684 | }], |
| 685 | |
hendrikw | 855dc93 | 2015-10-27 10:04:34 -0700 | [diff] [blame] | 686 | [ 'skia_command_buffer and skia_os == "mac"', { |
| 687 | 'xcode_settings': { |
| 688 | 'LD_RUNPATH_SEARCH_PATHS': ['@executable_path/.'], |
| 689 | }, |
| 690 | }], |
| 691 | |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 692 | ], # end 'conditions' |
caryclark@google.com | 4588ce8 | 2012-09-26 15:48:43 +0000 | [diff] [blame] | 693 | # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details |
| 694 | 'xcode_settings': { |
| 695 | 'SYMROOT': '<(DEPTH)/xcodebuild', |
| 696 | }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 697 | } |