1 # conditions used in both common.gypi and skia.gyp in chromium
5 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=<(skia_static_initializers)',
6 'SK_SUPPORT_GPU=<(skia_gpu)',
7 'SK_SUPPORT_OPENCL=<(skia_opencl)',
8 'SK_DISTANCEFIELD_FONTS=<(skia_distancefield_fonts)',
15 '_CRT_SECURE_NO_WARNINGS',
16 'GR_GL_FUNCTION_TYPE=__stdcall',
18 'msvs_cygwin_shell': 0,
22 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
23 'DebugInformationFormat': '3',
24 'ExceptionHandling': '0',
25 'AdditionalOptions': [ '/MP', ],
28 'AdditionalDependencies': [
32 # Prior to gyp r1584, the following were included automatically.
53 'DebugInformationFormat': '4', # editAndContiue (/ZI)
54 'Optimization': '0', # optimizeDisabled (/Od)
55 'PreprocessorDefinitions': ['_DEBUG'],
56 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd)
57 'RuntimeTypeInfo': 'false', # /GR-
60 'GenerateDebugInformation': 'true', # /DEBUG
61 'LinkIncremental': '2', # /INCREMENTAL
68 'DebugInformationFormat': '3', # programDatabase (/Zi)
69 'Optimization': '<(skia_release_optimization_level)',
70 'WholeProgramOptimization': 'true', #/GL
71 # Changing the floating point model requires rebaseling gm images
72 #'FloatingPointModel': '2', # fast (/fp:fast)
73 'FavorSizeOrSpeed': '1', # speed (/Ot)
74 'PreprocessorDefinitions': ['NDEBUG'],
75 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD)
76 'EnableEnhancedInstructionSet': '2',# /arch:SSE2
77 'RuntimeTypeInfo': 'false', # /GR-
80 'GenerateDebugInformation': 'true', # /DEBUG
81 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG
84 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG
90 [ 'skia_arch_width == 64', {
91 'msvs_configuration_platform': 'x64',
93 [ 'skia_arch_width == 32', {
94 'msvs_configuration_platform': 'Win32',
96 [ 'skia_warnings_as_errors', {
99 'WarnAsError': 'true',
100 'AdditionalOptions': [
101 '/we4189', # initialized but unused var warning
106 [ 'skia_win_exceptions', {
108 'VCCLCompilerTool': {
109 'AdditionalOptions': [
119 # The following section is common to linux + derivatives and android
120 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos", "android"]',
132 '-Wno-unused-parameter',
133 '-Wno-c++11-extensions',
137 '-Wnon-virtual-dtor',
140 [ 'skia_warnings_as_errors', {
145 # For profiling; reveals some costs, exaggerates others (e.g. trivial setters & getters).
146 [ 'skia_disable_inlining', {
149 '-fno-default-inline',
151 '-fno-omit-frame-pointer',
154 [ 'skia_arch_type == "arm" and arm_thumb == 1', {
158 # The --fix-cortex-a8 switch enables a link-time workaround for
159 # an erratum in certain Cortex-A8 processors. The workaround is
160 # enabled by default if you target the ARM v7-A arch profile.
161 # It can be enabled otherwise by specifying --fix-cortex-a8, or
162 # disabled unconditionally by specifying --no-fix-cortex-a8.
164 # The erratum only affects Thumb-2 code.
166 [ 'arm_version < 7', {
168 '-Wl,--fix-cortex-a8',
173 [ 'skia_arch_type == "arm" and arm_version >= 7', {
189 [ 'arm_neon_optional == 1', {
191 '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
194 [ 'skia_os != "chromeos"', {
196 '-mfloat-abi=softfp',
205 ['skia_android_framework', {
207 # Skia does not enforce this usage pattern so we disable it here to avoid
208 # unecessary log spew when building
209 '-Wno-unused-parameter',
211 # Android's -D_FORTIFY_SOURCE=2 extensions are incompatibile with SkString.
212 # Revert to -D_FORTIFY_SOURCE=1
214 '-D_FORTIFY_SOURCE=1',
217 'DCT_IFAST_SUPPORTED',
218 # using freetype's embolden allows us to adjust fake bold settings at
219 # draw-time, at which point we know which SkTypeface is being drawn
220 'SK_USE_FREETYPE_EMBOLDEN',
221 # Android provides at least FreeType 2.4.0 at runtime.
222 'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020400',
223 # Skia should not use dlopen on Android.
224 'SK_CAN_USE_DLOPEN=0',
228 [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos"]',
236 'cflags': ['--coverage'],
237 'ldflags': ['--coverage'],
243 '-O<(skia_release_optimization_level)',
245 'defines': [ 'NDEBUG' ],
249 [ 'skia_shared_lib', {
255 'SKIA_IMPLEMENTATION=1',
258 [ 'skia_os == "nacl"', {
270 }, { # skia_os != "nacl"
278 [ 'skia_os != "chromeos"', {
280 [ 'skia_arch_width == 64 and skia_arch_type == "x86"', {
288 [ 'skia_arch_width == 32 and skia_arch_type == "x86"', {
298 # Enable asan, tsan, etc.
299 [ 'skia_sanitizer', {
301 '-fsanitize=<(skia_sanitizer)',
304 '-fsanitize=<(skia_sanitizer)',
307 [ 'skia_sanitizer == "thread"', {
308 'defines': [ 'DYNAMIC_ANNOTATIONS_ENABLED=1' ],
309 'cflags': [ '-fPIC' ],
310 'target_conditions': [
311 [ '_type == "executable"', {
312 'cflags': [ '-fPIE' ],
313 'ldflags': [ '-pie' ],
319 [ 'skia_clang_build', {
321 # Extra warnings we like but that only Clang knows about.
322 '-Wstring-conversion',
325 [ 'skia_keep_frame_pointer', {
326 'cflags': [ '-fno-omit-frame-pointer' ],
332 [ 'skia_os == "mac"',
338 [ 'skia_arch_width == 64', {
343 [ 'skia_arch_width == 32', {
348 [ 'skia_warnings_as_errors', {
350 'OTHER_CPLUSPLUSFLAGS': [
354 '-Wno-unused-parameter',
355 '-Wno-uninitialized', # Disabled because we think GCC 4.2 is bad at this.
363 'GCC_OPTIMIZATION_LEVEL': '0',
364 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES',
365 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS' : 'YES',
370 'GCC_OPTIMIZATION_LEVEL': '0',
375 'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)',
377 'defines': [ 'NDEBUG' ],
381 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
383 [ 'skia_osx_deployment_target==""', {
384 'MACOSX_DEPLOYMENT_TARGET': '10.6', # -mmacos-version-min, passed in environment to ld.
386 'MACOSX_DEPLOYMENT_TARGET': '<(skia_osx_deployment_target)',
389 # trying to get this to work, but it needs clang I think...
390 # 'WARNING_CFLAGS': '-Wexit-time-destructors',
391 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
392 'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
393 'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
394 'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
395 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
396 'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
397 'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
398 'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
399 'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
400 'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
401 'GCC_WARN_MISSING_PARENTHESES': 'YES',
402 'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
403 'GCC_WARN_SIGN_COMPARE': 'YES',
404 'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
405 'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
406 'GCC_WARN_UNUSED_FUNCTION': 'YES',
407 'GCC_WARN_UNUSED_LABEL': 'YES',
408 'GCC_WARN_UNUSED_VALUE': 'YES',
409 'GCC_WARN_UNUSED_VARIABLE': 'YES',
410 'OTHER_CPLUSPLUSFLAGS': [
412 '-fvisibility=hidden',
413 '-fvisibility-inlines-hidden',
419 [ 'skia_os == "ios"',
425 [ 'skia_warnings_as_errors', {
427 'OTHER_CPLUSPLUSFLAGS': [
436 'GCC_OPTIMIZATION_LEVEL': '0',
441 'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)',
443 'defines': [ 'NDEBUG' ],
447 'ARCHS': ['armv6', 'armv7'],
448 'CODE_SIGNING_REQUIRED': 'NO',
449 'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
450 'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)',
451 'SDKROOT': 'iphoneos',
452 'TARGETED_DEVICE_FAMILY': '1,2',
453 'OTHER_CPLUSPLUSFLAGS': [
454 '-fvisibility=hidden',
455 '-fvisibility-inlines-hidden',
457 'GCC_THUMB_SUPPORT': 'NO',
462 [ 'skia_os == "android"',
465 'SK_BUILD_FOR_ANDROID',
466 'SK_FONTHOST_DOES_NOT_USE_FONTMGR',
474 'defines': [ 'NDEBUG' ],
486 [ 'skia_android_framework', {
492 [ 'skia_shared_lib', {
498 'SKIA_IMPLEMENTATION=1',
501 [ 'skia_profile_enabled == 1', {
502 'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'],
508 # We can POD-style initialization of static mutexes to avoid generating
509 # static initializers if we're using a pthread-compatible thread interface.
510 [ 'skia_os != "win"', {
512 'SK_USE_POSIX_THREADS',
515 ], # end 'conditions'
516 # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details
518 'SYMROOT': '<(DEPTH)/xcodebuild',