seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 1 | # conditions used in both common.gypi and skia.gyp in chromium |
| 2 | # |
| 3 | { |
chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 4 | 'defines': [ |
| 5 | 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=<(skia_static_initializers)', |
mtklein@google.com | dad7070 | 2013-11-20 18:06:10 +0000 | [diff] [blame] | 6 | 'SK_SUPPORT_GPU=<(skia_gpu)', |
| 7 | 'SK_SUPPORT_OPENCL=<(skia_opencl)', |
commit-bot@chromium.org | ae79612 | 2014-03-12 17:05:46 +0000 | [diff] [blame^] | 8 | 'SK_FORCE_DISTANCEFIELD_FONTS=<(skia_force_distancefield_fonts)', |
chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 9 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 10 | 'conditions' : [ |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 11 | [ 'skia_os == "win"', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 12 | { |
| 13 | 'defines': [ |
| 14 | 'SK_BUILD_FOR_WIN32', |
bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 15 | '_CRT_SECURE_NO_WARNINGS', |
senorblanco@chromium.org | 5f47a39 | 2012-07-12 00:34:39 +0000 | [diff] [blame] | 16 | 'GR_GL_FUNCTION_TYPE=__stdcall', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 17 | ], |
| 18 | 'msvs_cygwin_shell': 0, |
| 19 | 'msvs_settings': { |
| 20 | 'VCCLCompilerTool': { |
bsalomon@google.com | b58a639 | 2013-03-21 20:29:05 +0000 | [diff] [blame] | 21 | 'WarningLevel': '3', |
| 22 | 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 23 | 'DebugInformationFormat': '3', |
bsalomon@google.com | b58a639 | 2013-03-21 20:29:05 +0000 | [diff] [blame] | 24 | 'ExceptionHandling': '0', |
| 25 | 'AdditionalOptions': [ '/MP', ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 26 | }, |
| 27 | 'VCLinkerTool': { |
| 28 | 'AdditionalDependencies': [ |
| 29 | 'OpenGL32.lib', |
| 30 | 'usp10.lib', |
bungeman@google.com | f51e125 | 2013-06-05 18:35:22 +0000 | [diff] [blame] | 31 | |
| 32 | # Prior to gyp r1584, the following were included automatically. |
| 33 | 'kernel32.lib', |
| 34 | 'gdi32.lib', |
| 35 | 'winspool.lib', |
| 36 | 'comdlg32.lib', |
| 37 | 'advapi32.lib', |
| 38 | 'shell32.lib', |
| 39 | 'ole32.lib', |
| 40 | 'oleaut32.lib', |
| 41 | 'user32.lib', |
| 42 | 'uuid.lib', |
| 43 | 'odbc32.lib', |
| 44 | 'odbccp32.lib', |
bsalomon@google.com | bbba784 | 2013-06-06 18:34:13 +0000 | [diff] [blame] | 45 | 'DelayImp.lib', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 46 | ], |
| 47 | }, |
| 48 | }, |
| 49 | 'configurations': { |
| 50 | 'Debug': { |
| 51 | 'msvs_settings': { |
| 52 | 'VCCLCompilerTool': { |
bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 53 | 'DebugInformationFormat': '4', # editAndContiue (/ZI) |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 54 | 'Optimization': '0', # optimizeDisabled (/Od) |
| 55 | 'PreprocessorDefinitions': ['_DEBUG'], |
| 56 | 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd) |
bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 57 | 'RuntimeTypeInfo': 'false', # /GR- |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 58 | }, |
| 59 | 'VCLinkerTool': { |
bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 60 | 'GenerateDebugInformation': 'true', # /DEBUG |
| 61 | 'LinkIncremental': '2', # /INCREMENTAL |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 62 | }, |
| 63 | }, |
| 64 | }, |
| 65 | 'Release': { |
| 66 | 'msvs_settings': { |
| 67 | 'VCCLCompilerTool': { |
bsalomon@google.com | 9aabfc7 | 2012-05-31 14:12:46 +0000 | [diff] [blame] | 68 | 'DebugInformationFormat': '3', # programDatabase (/Zi) |
commit-bot@chromium.org | 06b3864 | 2013-06-20 20:28:54 +0000 | [diff] [blame] | 69 | 'Optimization': '<(skia_release_optimization_level)', |
bsalomon@google.com | d971869 | 2013-04-22 14:56:50 +0000 | [diff] [blame] | 70 | 'WholeProgramOptimization': 'true', #/GL |
bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 71 | # Changing the floating point model requires rebaseling gm images |
bsalomon@google.com | 9aabfc7 | 2012-05-31 14:12:46 +0000 | [diff] [blame] | 72 | #'FloatingPointModel': '2', # fast (/fp:fast) |
| 73 | 'FavorSizeOrSpeed': '1', # speed (/Ot) |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 74 | 'PreprocessorDefinitions': ['NDEBUG'], |
bsalomon@google.com | 9aabfc7 | 2012-05-31 14:12:46 +0000 | [diff] [blame] | 75 | 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD) |
bsalomon@google.com | 9aabfc7 | 2012-05-31 14:12:46 +0000 | [diff] [blame] | 76 | 'EnableEnhancedInstructionSet': '2',# /arch:SSE2 |
| 77 | 'RuntimeTypeInfo': 'false', # /GR- |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 78 | }, |
| 79 | 'VCLinkerTool': { |
bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 80 | 'GenerateDebugInformation': 'true', # /DEBUG |
bsalomon@google.com | d971869 | 2013-04-22 14:56:50 +0000 | [diff] [blame] | 81 | 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 82 | }, |
bungeman@google.com | 983297e | 2011-10-03 19:36:51 +0000 | [diff] [blame] | 83 | 'VCLibrarianTool': { |
bsalomon@google.com | d971869 | 2013-04-22 14:56:50 +0000 | [diff] [blame] | 84 | 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG |
bungeman@google.com | 983297e | 2011-10-03 19:36:51 +0000 | [diff] [blame] | 85 | }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 86 | }, |
| 87 | }, |
| 88 | }, |
borenet@google.com | b796119 | 2012-08-20 18:58:26 +0000 | [diff] [blame] | 89 | 'conditions' : [ |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 90 | [ 'skia_arch_width == 64', { |
bsalomon@google.com | 1d03ba9 | 2013-01-08 20:40:22 +0000 | [diff] [blame] | 91 | 'msvs_configuration_platform': 'x64', |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 92 | }], |
| 93 | [ 'skia_arch_width == 32', { |
| 94 | 'msvs_configuration_platform': 'Win32', |
| 95 | }], |
| 96 | [ 'skia_warnings_as_errors', { |
bsalomon@google.com | 1d03ba9 | 2013-01-08 20:40:22 +0000 | [diff] [blame] | 97 | 'msvs_settings': { |
| 98 | 'VCCLCompilerTool': { |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 99 | 'WarnAsError': 'true', |
| 100 | 'AdditionalOptions': [ |
| 101 | '/we4189', # initialized but unused var warning |
| 102 | ], |
bsalomon@google.com | 1d03ba9 | 2013-01-08 20:40:22 +0000 | [diff] [blame] | 103 | }, |
| 104 | }, |
borenet@google.com | b796119 | 2012-08-20 18:58:26 +0000 | [diff] [blame] | 105 | }], |
commit-bot@chromium.org | 5a6c2d8 | 2013-06-14 17:10:09 +0000 | [diff] [blame] | 106 | [ 'skia_win_exceptions', { |
| 107 | 'msvs_settings': { |
| 108 | 'VCCLCompilerTool': { |
| 109 | 'AdditionalOptions': [ |
| 110 | '/EHsc', |
| 111 | ], |
| 112 | }, |
| 113 | }, |
| 114 | }], |
borenet@google.com | b796119 | 2012-08-20 18:58:26 +0000 | [diff] [blame] | 115 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 116 | }, |
| 117 | ], |
| 118 | |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 119 | # The following section is common to linux + derivatives and android |
| 120 | [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos", "android"]', |
| 121 | { |
mtklein@google.com | f1077f9 | 2013-11-20 15:13:49 +0000 | [diff] [blame] | 122 | 'cflags': [ |
mtklein@google.com | dad7070 | 2013-11-20 18:06:10 +0000 | [diff] [blame] | 123 | '-g', |
mtklein@google.com | f1077f9 | 2013-11-20 15:13:49 +0000 | [diff] [blame] | 124 | '-fno-exceptions', |
| 125 | '-fstrict-aliasing', |
mtklein@google.com | dad7070 | 2013-11-20 18:06:10 +0000 | [diff] [blame] | 126 | |
mtklein@google.com | f1077f9 | 2013-11-20 15:13:49 +0000 | [diff] [blame] | 127 | '-Wall', |
| 128 | '-Wextra', |
| 129 | '-Winit-self', |
| 130 | '-Wpointer-arith', |
| 131 | |
| 132 | '-Wno-unused-parameter', |
mtklein@google.com | f1077f9 | 2013-11-20 15:13:49 +0000 | [diff] [blame] | 133 | ], |
| 134 | 'cflags_cc': [ |
| 135 | '-fno-rtti', |
| 136 | '-Wnon-virtual-dtor', |
| 137 | ], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 138 | 'conditions': [ |
commit-bot@chromium.org | 93f5e51 | 2014-02-17 15:22:26 +0000 | [diff] [blame] | 139 | [ 'skia_android_framework==0', { |
| 140 | 'cflags': [ |
| 141 | # This flag is not supported by Android build system. |
| 142 | '-Wno-c++11-extensions', |
| 143 | ], |
| 144 | }], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 145 | [ 'skia_warnings_as_errors', { |
| 146 | 'cflags': [ |
| 147 | '-Werror', |
| 148 | ], |
| 149 | }], |
commit-bot@chromium.org | 35d4872 | 2014-02-13 18:36:36 +0000 | [diff] [blame] | 150 | # For profiling; reveals some costs, exaggerates others (e.g. trivial setters & getters). |
| 151 | [ 'skia_disable_inlining', { |
| 152 | 'cflags': [ |
| 153 | '-fno-inline', |
| 154 | '-fno-default-inline', |
| 155 | '-finline-limit=0', |
| 156 | '-fno-omit-frame-pointer', |
| 157 | ], |
| 158 | }], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 159 | [ 'skia_arch_type == "arm" and arm_thumb == 1', { |
| 160 | 'cflags': [ |
| 161 | '-mthumb', |
| 162 | ], |
djsollen@google.com | f7542ba | 2013-07-31 12:57:27 +0000 | [diff] [blame] | 163 | # The --fix-cortex-a8 switch enables a link-time workaround for |
| 164 | # an erratum in certain Cortex-A8 processors. The workaround is |
| 165 | # enabled by default if you target the ARM v7-A arch profile. |
| 166 | # It can be enabled otherwise by specifying --fix-cortex-a8, or |
| 167 | # disabled unconditionally by specifying --no-fix-cortex-a8. |
| 168 | # |
| 169 | # The erratum only affects Thumb-2 code. |
| 170 | 'conditions': [ |
| 171 | [ 'arm_version < 7', { |
| 172 | 'ldflags': [ |
| 173 | '-Wl,--fix-cortex-a8', |
| 174 | ], |
| 175 | }], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 176 | ], |
djsollen@google.com | f7542ba | 2013-07-31 12:57:27 +0000 | [diff] [blame] | 177 | }], |
| 178 | [ 'skia_arch_type == "arm" and arm_version >= 7', { |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 179 | 'cflags': [ |
| 180 | '-march=armv7-a', |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 181 | ], |
djsollen@google.com | f7542ba | 2013-07-31 12:57:27 +0000 | [diff] [blame] | 182 | 'ldflags': [ |
| 183 | '-march=armv7-a', |
| 184 | ], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 185 | 'conditions': [ |
| 186 | [ 'arm_neon == 1', { |
| 187 | 'defines': [ |
| 188 | '__ARM_HAVE_NEON', |
| 189 | ], |
| 190 | 'cflags': [ |
| 191 | '-mfpu=neon', |
| 192 | ], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 193 | }], |
| 194 | [ 'arm_neon_optional == 1', { |
| 195 | 'defines': [ |
| 196 | '__ARM_HAVE_OPTIONAL_NEON_SUPPORT', |
| 197 | ], |
| 198 | }], |
borenet@google.com | e2b9037 | 2013-07-11 18:46:30 +0000 | [diff] [blame] | 199 | [ 'skia_os != "chromeos"', { |
| 200 | 'cflags': [ |
| 201 | '-mfloat-abi=softfp', |
| 202 | ], |
| 203 | }], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 204 | ], |
| 205 | }], |
| 206 | ], |
| 207 | }, |
| 208 | ], |
| 209 | |
scroggo@google.com | d4adfa3 | 2014-02-05 16:35:12 +0000 | [diff] [blame] | 210 | ['skia_android_framework', { |
| 211 | 'cflags': [ |
| 212 | # Skia does not enforce this usage pattern so we disable it here to avoid |
| 213 | # unecessary log spew when building |
| 214 | '-Wno-unused-parameter', |
| 215 | |
| 216 | # Android's -D_FORTIFY_SOURCE=2 extensions are incompatibile with SkString. |
| 217 | # Revert to -D_FORTIFY_SOURCE=1 |
| 218 | '-U_FORTIFY_SOURCE', |
| 219 | '-D_FORTIFY_SOURCE=1', |
| 220 | ], |
commit-bot@chromium.org | e72a408 | 2014-02-28 16:07:39 +0000 | [diff] [blame] | 221 | 'cflags!': [ |
| 222 | '-g', |
| 223 | '-march=armv7-a', |
| 224 | '-mthumb', |
| 225 | '-mfpu=neon', |
| 226 | '-mfloat-abi=softfp', |
| 227 | ], |
scroggo@google.com | d4adfa3 | 2014-02-05 16:35:12 +0000 | [diff] [blame] | 228 | 'defines': [ |
| 229 | 'DCT_IFAST_SUPPORTED', |
| 230 | # using freetype's embolden allows us to adjust fake bold settings at |
| 231 | # draw-time, at which point we know which SkTypeface is being drawn |
| 232 | 'SK_USE_FREETYPE_EMBOLDEN', |
| 233 | # Android provides at least FreeType 2.4.0 at runtime. |
| 234 | 'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020400', |
| 235 | # Skia should not use dlopen on Android. |
| 236 | 'SK_CAN_USE_DLOPEN=0', |
| 237 | ], |
| 238 | }], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 239 | |
borenet@google.com | 05d550e | 2013-06-11 15:52:19 +0000 | [diff] [blame] | 240 | [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos"]', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 241 | { |
| 242 | 'defines': [ |
| 243 | 'SK_SAMPLES_FOR_X', |
| 244 | 'SK_BUILD_FOR_UNIX', |
| 245 | ], |
| 246 | 'configurations': { |
mtklein@google.com | 1fb04e2 | 2013-09-13 19:32:43 +0000 | [diff] [blame] | 247 | 'Coverage': { |
mtklein@google.com | dad7070 | 2013-11-20 18:06:10 +0000 | [diff] [blame] | 248 | 'cflags': ['--coverage'], |
mtklein@google.com | 1fb04e2 | 2013-09-13 19:32:43 +0000 | [diff] [blame] | 249 | 'ldflags': ['--coverage'], |
| 250 | }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 251 | 'Debug': { |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 252 | }, |
| 253 | 'Release': { |
commit-bot@chromium.org | 06b3864 | 2013-06-20 20:28:54 +0000 | [diff] [blame] | 254 | 'cflags': [ |
| 255 | '-O<(skia_release_optimization_level)', |
commit-bot@chromium.org | 06b3864 | 2013-06-20 20:28:54 +0000 | [diff] [blame] | 256 | ], |
senorblanco@chromium.org | 7288c49 | 2012-01-19 19:59:22 +0000 | [diff] [blame] | 257 | 'defines': [ 'NDEBUG' ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 258 | }, |
| 259 | }, |
borenet@google.com | a37a517 | 2012-08-09 20:44:32 +0000 | [diff] [blame] | 260 | 'conditions' : [ |
zachr@google.com | 28c27c8 | 2013-06-20 17:15:05 +0000 | [diff] [blame] | 261 | [ 'skia_shared_lib', { |
| 262 | 'cflags': [ |
| 263 | '-fPIC', |
| 264 | ], |
| 265 | 'defines': [ |
zachr@google.com | 28c27c8 | 2013-06-20 17:15:05 +0000 | [diff] [blame] | 266 | 'SKIA_DLL', |
| 267 | 'SKIA_IMPLEMENTATION=1', |
| 268 | ], |
| 269 | }], |
borenet@google.com | 7158e6a | 2012-11-01 17:43:44 +0000 | [diff] [blame] | 270 | [ 'skia_os == "nacl"', { |
| 271 | 'defines': [ |
| 272 | 'SK_BUILD_FOR_NACL', |
| 273 | ], |
commit-bot@chromium.org | fe42410 | 2014-02-21 00:40:16 +0000 | [diff] [blame] | 274 | 'variables': { |
| 275 | 'nacl_sdk_root': '<!(["echo", "${NACL_SDK_ROOT}"])', |
| 276 | }, |
borenet@google.com | 7158e6a | 2012-11-01 17:43:44 +0000 | [diff] [blame] | 277 | 'link_settings': { |
| 278 | 'libraries': [ |
| 279 | '-lppapi', |
| 280 | '-lppapi_cpp', |
| 281 | '-lnosys', |
| 282 | '-pthread', |
| 283 | ], |
commit-bot@chromium.org | fe42410 | 2014-02-21 00:40:16 +0000 | [diff] [blame] | 284 | 'ldflags': [ |
| 285 | '-L<(nacl_sdk_root)/lib/newlib_x86_<(skia_arch_width)/Release', |
| 286 | '-L<(nacl_sdk_root)/ports/lib/newlib_x86_<(skia_arch_width)/Release', |
| 287 | ], |
borenet@google.com | 7158e6a | 2012-11-01 17:43:44 +0000 | [diff] [blame] | 288 | }, |
borenet@google.com | cb9445d | 2013-08-19 18:26:04 +0000 | [diff] [blame] | 289 | }, { # skia_os != "nacl" |
| 290 | 'link_settings': { |
| 291 | 'ldflags': [ |
| 292 | '-lstdc++', |
| 293 | '-lm', |
| 294 | ], |
| 295 | }, |
borenet@google.com | 7158e6a | 2012-11-01 17:43:44 +0000 | [diff] [blame] | 296 | }], |
borenet@google.com | cb9445d | 2013-08-19 18:26:04 +0000 | [diff] [blame] | 297 | [ 'skia_os != "chromeos"', { |
borenet@google.com | 05d550e | 2013-06-11 15:52:19 +0000 | [diff] [blame] | 298 | 'conditions': [ |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 299 | [ 'skia_arch_width == 64 and skia_arch_type == "x86"', { |
borenet@google.com | 05d550e | 2013-06-11 15:52:19 +0000 | [diff] [blame] | 300 | 'cflags': [ |
| 301 | '-m64', |
| 302 | ], |
| 303 | 'ldflags': [ |
| 304 | '-m64', |
| 305 | ], |
| 306 | }], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 307 | [ 'skia_arch_width == 32 and skia_arch_type == "x86"', { |
borenet@google.com | 05d550e | 2013-06-11 15:52:19 +0000 | [diff] [blame] | 308 | 'cflags': [ |
| 309 | '-m32', |
| 310 | ], |
| 311 | 'ldflags': [ |
| 312 | '-m32', |
| 313 | ], |
| 314 | }], |
| 315 | ], |
| 316 | }], |
mtklein@google.com | 9f3b0e4 | 2013-10-08 15:16:36 +0000 | [diff] [blame] | 317 | # Enable asan, tsan, etc. |
| 318 | [ 'skia_sanitizer', { |
borenet@google.com | 0d19309 | 2013-07-03 15:55:05 +0000 | [diff] [blame] | 319 | 'cflags': [ |
mtklein@google.com | 9f3b0e4 | 2013-10-08 15:16:36 +0000 | [diff] [blame] | 320 | '-fsanitize=<(skia_sanitizer)', |
borenet@google.com | 0d19309 | 2013-07-03 15:55:05 +0000 | [diff] [blame] | 321 | ], |
| 322 | 'ldflags': [ |
mtklein@google.com | 9f3b0e4 | 2013-10-08 15:16:36 +0000 | [diff] [blame] | 323 | '-fsanitize=<(skia_sanitizer)', |
bungeman@google.com | 1435f9f | 2013-09-25 22:39:22 +0000 | [diff] [blame] | 324 | ], |
mtklein@google.com | 3a19fb5 | 2013-10-09 16:12:23 +0000 | [diff] [blame] | 325 | 'conditions' : [ |
| 326 | [ 'skia_sanitizer == "thread"', { |
| 327 | 'defines': [ 'DYNAMIC_ANNOTATIONS_ENABLED=1' ], |
bungeman@google.com | 0fbe01f | 2013-10-10 17:24:17 +0000 | [diff] [blame] | 328 | 'cflags': [ '-fPIC' ], |
bungeman@google.com | 27d4ffe | 2013-10-10 17:09:49 +0000 | [diff] [blame] | 329 | 'target_conditions': [ |
| 330 | [ '_type == "executable"', { |
| 331 | 'cflags': [ '-fPIE' ], |
| 332 | 'ldflags': [ '-pie' ], |
| 333 | }], |
| 334 | ], |
mtklein@google.com | 3a19fb5 | 2013-10-09 16:12:23 +0000 | [diff] [blame] | 335 | }], |
| 336 | ], |
bungeman@google.com | 1435f9f | 2013-09-25 22:39:22 +0000 | [diff] [blame] | 337 | }], |
borenet@google.com | 47ae4b0 | 2013-08-21 18:02:50 +0000 | [diff] [blame] | 338 | [ 'skia_clang_build', { |
| 339 | 'cflags': [ |
mtklein@google.com | 9f3b0e4 | 2013-10-08 15:16:36 +0000 | [diff] [blame] | 340 | # Extra warnings we like but that only Clang knows about. |
borenet@google.com | 47ae4b0 | 2013-08-21 18:02:50 +0000 | [diff] [blame] | 341 | '-Wstring-conversion', |
| 342 | ], |
| 343 | }], |
commit-bot@chromium.org | 5003bde | 2013-10-25 18:14:54 +0000 | [diff] [blame] | 344 | [ 'skia_keep_frame_pointer', { |
| 345 | 'cflags': [ '-fno-omit-frame-pointer' ], |
| 346 | }], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 347 | ], |
| 348 | }, |
| 349 | ], |
| 350 | |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 351 | [ 'skia_os == "mac"', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 352 | { |
| 353 | 'defines': [ |
| 354 | 'SK_BUILD_FOR_MAC', |
| 355 | ], |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 356 | 'conditions' : [ |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 357 | [ 'skia_arch_width == 64', { |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 358 | 'xcode_settings': { |
commit-bot@chromium.org | 5d7ca95 | 2013-04-22 20:26:44 +0000 | [diff] [blame] | 359 | 'ARCHS': ['x86_64'], |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 360 | }, |
| 361 | }], |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 362 | [ 'skia_arch_width == 32', { |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 363 | 'xcode_settings': { |
commit-bot@chromium.org | 5d7ca95 | 2013-04-22 20:26:44 +0000 | [diff] [blame] | 364 | 'ARCHS': ['i386'], |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 365 | }, |
| 366 | }], |
| 367 | [ 'skia_warnings_as_errors', { |
| 368 | 'xcode_settings': { |
humper@google.com | fe0d680 | 2013-01-07 20:28:16 +0000 | [diff] [blame] | 369 | 'OTHER_CPLUSPLUSFLAGS': [ |
| 370 | '-Werror', |
commit-bot@chromium.org | faa5ae4 | 2013-07-23 11:13:56 +0000 | [diff] [blame] | 371 | '-Wall', |
| 372 | '-Wextra', |
| 373 | '-Wno-unused-parameter', |
commit-bot@chromium.org | 6a18079 | 2014-01-15 21:39:18 +0000 | [diff] [blame] | 374 | '-Wno-uninitialized', # Disabled because we think GCC 4.2 is bad at this. |
mtklein@google.com | 8d725b2 | 2013-07-24 16:20:05 +0000 | [diff] [blame] | 375 | ], |
| 376 | }, |
| 377 | }], |
djsollen@google.com | e341cb3 | 2012-06-28 16:08:05 +0000 | [diff] [blame] | 378 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 379 | 'configurations': { |
commit-bot@chromium.org | 866f4e3 | 2013-11-21 17:04:29 +0000 | [diff] [blame] | 380 | 'Coverage': { |
| 381 | 'xcode_settings': { |
| 382 | 'GCC_OPTIMIZATION_LEVEL': '0', |
| 383 | 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', |
| 384 | 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS' : 'YES', |
| 385 | }, |
| 386 | }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 387 | 'Debug': { |
| 388 | 'xcode_settings': { |
| 389 | 'GCC_OPTIMIZATION_LEVEL': '0', |
| 390 | }, |
| 391 | }, |
reed@google.com | e05cc8e | 2011-10-10 14:19:40 +0000 | [diff] [blame] | 392 | 'Release': { |
| 393 | 'xcode_settings': { |
commit-bot@chromium.org | 06b3864 | 2013-06-20 20:28:54 +0000 | [diff] [blame] | 394 | 'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)', |
reed@google.com | e05cc8e | 2011-10-10 14:19:40 +0000 | [diff] [blame] | 395 | }, |
senorblanco@chromium.org | 7288c49 | 2012-01-19 19:59:22 +0000 | [diff] [blame] | 396 | 'defines': [ 'NDEBUG' ], |
reed@google.com | e05cc8e | 2011-10-10 14:19:40 +0000 | [diff] [blame] | 397 | }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 398 | }, |
| 399 | 'xcode_settings': { |
robertphillips@google.com | 0229765 | 2012-04-05 19:29:04 +0000 | [diff] [blame] | 400 | 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO', |
senorblanco@chromium.org | 29f351a | 2014-01-20 16:14:02 +0000 | [diff] [blame] | 401 | 'conditions': [ |
| 402 | [ 'skia_osx_deployment_target==""', { |
| 403 | 'MACOSX_DEPLOYMENT_TARGET': '10.6', # -mmacos-version-min, passed in environment to ld. |
| 404 | }, { |
| 405 | 'MACOSX_DEPLOYMENT_TARGET': '<(skia_osx_deployment_target)', |
| 406 | }], |
| 407 | ], |
reed@google.com | 0069aa5 | 2011-11-17 15:35:47 +0000 | [diff] [blame] | 408 | # trying to get this to work, but it needs clang I think... |
| 409 | # 'WARNING_CFLAGS': '-Wexit-time-destructors', |
mike@reedtribe.org | e51755f | 2011-12-10 19:36:56 +0000 | [diff] [blame] | 410 | 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO', |
caryclark@google.com | b462a42 | 2012-06-06 12:12:28 +0000 | [diff] [blame] | 411 | 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES', |
| 412 | 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES', |
| 413 | 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES', |
| 414 | 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', |
| 415 | 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES', |
| 416 | 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES', |
| 417 | 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES', |
| 418 | 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES', |
| 419 | 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES', |
| 420 | 'GCC_WARN_MISSING_PARENTHESES': 'YES', |
| 421 | 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES', |
| 422 | 'GCC_WARN_SIGN_COMPARE': 'YES', |
| 423 | 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES', |
| 424 | 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES', |
| 425 | 'GCC_WARN_UNUSED_FUNCTION': 'YES', |
| 426 | 'GCC_WARN_UNUSED_LABEL': 'YES', |
| 427 | 'GCC_WARN_UNUSED_VALUE': 'YES', |
| 428 | 'GCC_WARN_UNUSED_VARIABLE': 'YES', |
bungeman@google.com | 43b4ed5 | 2012-10-02 15:42:21 +0000 | [diff] [blame] | 429 | 'OTHER_CPLUSPLUSFLAGS': [ |
| 430 | '-mssse3', |
| 431 | '-fvisibility=hidden', |
| 432 | '-fvisibility-inlines-hidden', |
| 433 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 434 | }, |
| 435 | }, |
| 436 | ], |
| 437 | |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 438 | [ 'skia_os == "ios"', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 439 | { |
| 440 | 'defines': [ |
| 441 | 'SK_BUILD_FOR_IOS', |
| 442 | ], |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 443 | 'conditions' : [ |
| 444 | [ 'skia_warnings_as_errors', { |
| 445 | 'xcode_settings': { |
| 446 | 'OTHER_CPLUSPLUSFLAGS': [ |
| 447 | '-Werror', |
| 448 | ], |
| 449 | }, |
| 450 | }], |
| 451 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 452 | 'configurations': { |
| 453 | 'Debug': { |
| 454 | 'xcode_settings': { |
| 455 | 'GCC_OPTIMIZATION_LEVEL': '0', |
| 456 | }, |
| 457 | }, |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 458 | 'Release': { |
| 459 | 'xcode_settings': { |
commit-bot@chromium.org | 06b3864 | 2013-06-20 20:28:54 +0000 | [diff] [blame] | 460 | 'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)', |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 461 | }, |
| 462 | 'defines': [ 'NDEBUG' ], |
| 463 | }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 464 | }, |
| 465 | 'xcode_settings': { |
commit-bot@chromium.org | 5d7ca95 | 2013-04-22 20:26:44 +0000 | [diff] [blame] | 466 | 'ARCHS': ['armv6', 'armv7'], |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 467 | 'CODE_SIGNING_REQUIRED': 'NO', |
| 468 | 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '', |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 469 | 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)', |
caryclark@google.com | 867cbd8 | 2012-09-20 15:45:41 +0000 | [diff] [blame] | 470 | 'SDKROOT': 'iphoneos', |
caryclark@google.com | 594dd3c | 2012-09-24 19:33:57 +0000 | [diff] [blame] | 471 | 'TARGETED_DEVICE_FAMILY': '1,2', |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 472 | 'OTHER_CPLUSPLUSFLAGS': [ |
| 473 | '-fvisibility=hidden', |
| 474 | '-fvisibility-inlines-hidden', |
| 475 | ], |
bsalomon@google.com | 89dec58 | 2012-09-28 18:33:11 +0000 | [diff] [blame] | 476 | 'GCC_THUMB_SUPPORT': 'NO', |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 477 | }, |
| 478 | }, |
| 479 | ], |
chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 480 | |
borenet@google.com | a72aef8 | 2013-03-22 13:16:06 +0000 | [diff] [blame] | 481 | [ 'skia_os == "android"', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 482 | { |
| 483 | 'defines': [ |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 484 | 'SK_BUILD_FOR_ANDROID', |
bungeman@google.com | 451b596 | 2013-11-11 18:36:46 +0000 | [diff] [blame] | 485 | 'SK_FONTHOST_DOES_NOT_USE_FONTMGR', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 486 | ], |
scroggo@google.com | eb62950 | 2014-02-04 16:08:48 +0000 | [diff] [blame] | 487 | 'configurations': { |
| 488 | 'Debug': { |
| 489 | 'cflags': ['-g'] |
| 490 | }, |
| 491 | 'Release': { |
| 492 | 'cflags': ['-O2'], |
| 493 | 'defines': [ 'NDEBUG' ], |
| 494 | }, |
| 495 | }, |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 496 | 'libraries': [ |
scroggo@google.com | eb62950 | 2014-02-04 16:08:48 +0000 | [diff] [blame] | 497 | '-lstdc++', |
| 498 | '-lm', |
djsollen@google.com | 318cf92 | 2011-11-08 19:03:43 +0000 | [diff] [blame] | 499 | '-llog', |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 500 | ], |
djsollen@google.com | 44360bc | 2011-12-05 13:55:55 +0000 | [diff] [blame] | 501 | 'cflags': [ |
borenet@google.com | de9ac14 | 2012-07-25 15:17:03 +0000 | [diff] [blame] | 502 | '-fuse-ld=gold', |
djsollen@google.com | 44360bc | 2011-12-05 13:55:55 +0000 | [diff] [blame] | 503 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 504 | 'conditions': [ |
scroggo@google.com | d4adfa3 | 2014-02-05 16:35:12 +0000 | [diff] [blame] | 505 | [ 'skia_android_framework', { |
| 506 | 'libraries!': [ |
| 507 | '-lstdc++', |
| 508 | '-lm', |
| 509 | ], |
| 510 | }], |
djsollen@google.com | 52f0297 | 2013-06-03 12:10:19 +0000 | [diff] [blame] | 511 | [ 'skia_shared_lib', { |
| 512 | 'cflags': [ |
| 513 | '-fPIC', |
| 514 | ], |
| 515 | 'defines': [ |
djsollen@google.com | 52f0297 | 2013-06-03 12:10:19 +0000 | [diff] [blame] | 516 | 'SKIA_DLL', |
| 517 | 'SKIA_IMPLEMENTATION=1', |
| 518 | ], |
| 519 | }], |
commit-bot@chromium.org | 183f7f5 | 2013-07-11 12:48:14 +0000 | [diff] [blame] | 520 | [ 'skia_profile_enabled == 1', { |
| 521 | 'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'], |
djsollen@google.com | 3839ca1 | 2011-11-03 17:31:41 +0000 | [diff] [blame] | 522 | }], |
chudy@google.com | bbad34d | 2012-08-13 14:26:36 +0000 | [diff] [blame] | 523 | ], |
djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 524 | }, |
| 525 | ], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 526 | |
digit@google.com | 1771cbf | 2012-01-26 21:26:40 +0000 | [diff] [blame] | 527 | # We can POD-style initialization of static mutexes to avoid generating |
| 528 | # static initializers if we're using a pthread-compatible thread interface. |
| 529 | [ 'skia_os != "win"', { |
| 530 | 'defines': [ |
borenet@google.com | 7158e6a | 2012-11-01 17:43:44 +0000 | [diff] [blame] | 531 | 'SK_USE_POSIX_THREADS', |
digit@google.com | 1771cbf | 2012-01-26 21:26:40 +0000 | [diff] [blame] | 532 | ], |
| 533 | }], |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 534 | ], # end 'conditions' |
caryclark@google.com | 4588ce8 | 2012-09-26 15:48:43 +0000 | [diff] [blame] | 535 | # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details |
| 536 | 'xcode_settings': { |
| 537 | 'SYMROOT': '<(DEPTH)/xcodebuild', |
| 538 | }, |
seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 539 | } |