common_conditions.gypi 21 KB
Newer Older
1 2 3
# conditions used in both common.gypi and skia.gyp in chromium
#
{
chudy@google.com's avatar
chudy@google.com committed
4 5
  'defines': [
    'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=<(skia_static_initializers)',
6 7
    'SK_SUPPORT_GPU=<(skia_gpu)',
    'SK_SUPPORT_OPENCL=<(skia_opencl)',
8
    'SK_FORCE_DISTANCEFIELD_FONTS=<(skia_force_distancefield_fonts)',
chudy@google.com's avatar
chudy@google.com committed
9
  ],
10
  'conditions' : [
11 12 13 14 15 16
    [ 'skia_arch_type == "arm64"', {
      'cflags': [
        '-ffp-contract=off',
      ],
    }],

commit-bot@chromium.org's avatar
commit-bot@chromium.org committed
17 18 19 20 21 22 23 24
    # As of M35, Chrome requires SSE2 on x86 (and SSSE3 on Mac).
    [ 'skia_arch_type == "x86"', {
      'cflags': [
        '-msse2',
        '-mfpmath=sse',
      ],
    }],

25
    [ 'skia_os == "win"',
26 27 28
      {
        'defines': [
          'SK_BUILD_FOR_WIN32',
29
          '_CRT_SECURE_NO_WARNINGS',
30
          'GR_GL_FUNCTION_TYPE=__stdcall',
31
        ],
32 33 34
        'msvs_disabled_warnings': [
            4345,  # This is an FYI about a behavior change from long ago.  Chrome stifles it too.
        ],
35 36 37
        'msvs_cygwin_shell': 0,
        'msvs_settings': {
          'VCCLCompilerTool': {
38 39
            'WarningLevel': '3',
            'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb',
40
            'DebugInformationFormat': '3',
41 42
            'ExceptionHandling': '0',
            'AdditionalOptions': [ '/MP', ],
43 44
          },
          'VCLinkerTool': {
45
            'LargeAddressAware': 2,  # 2 means "Yes, please let me use more RAM on 32-bit builds."
46 47 48
            'AdditionalDependencies': [
              'OpenGL32.lib',
              'usp10.lib',
49 50 51 52 53 54 55 56 57 58 59 60 61 62

              # Prior to gyp r1584, the following were included automatically.
              'kernel32.lib',
              'gdi32.lib',
              'winspool.lib',
              'comdlg32.lib',
              'advapi32.lib',
              'shell32.lib',
              'ole32.lib',
              'oleaut32.lib',
              'user32.lib',
              'uuid.lib',
              'odbc32.lib',
              'odbccp32.lib',
63
              'DelayImp.lib',
64 65 66 67 68 69 70
            ],
          },
        },
        'configurations': {
          'Debug': {
            'msvs_settings': {
              'VCCLCompilerTool': {
71
                'DebugInformationFormat': '4', # editAndContiue (/ZI)
72 73 74
                'Optimization': '0',           # optimizeDisabled (/Od)
                'PreprocessorDefinitions': ['_DEBUG'],
                'RuntimeLibrary': '3',         # rtMultiThreadedDebugDLL (/MDd)
75
                'RuntimeTypeInfo': 'false',      # /GR-
76 77
              },
              'VCLinkerTool': {
78 79
                'GenerateDebugInformation': 'true', # /DEBUG
                'LinkIncremental': '2',             # /INCREMENTAL
80 81 82 83 84 85
              },
            },
          },
          'Release': {
            'msvs_settings': {
              'VCCLCompilerTool': {
86
                'DebugInformationFormat': '3',      # programDatabase (/Zi)
87
                'Optimization': '<(skia_release_optimization_level)',
88
                'WholeProgramOptimization': 'true', #/GL
89
               # Changing the floating point model requires rebaseling gm images
90 91
               #'FloatingPointModel': '2',          # fast (/fp:fast)
                'FavorSizeOrSpeed': '1',            # speed (/Ot)
92
                'PreprocessorDefinitions': ['NDEBUG'],
93 94 95
                'RuntimeLibrary': '2',              # rtMultiThreadedDLL (/MD)
                'EnableEnhancedInstructionSet': '2',# /arch:SSE2
                'RuntimeTypeInfo': 'false',         # /GR-
96 97
              },
              'VCLinkerTool': {
98
                'GenerateDebugInformation': 'true', # /DEBUG
99
                'LinkTimeCodeGeneration': '1',      # useLinkTimeCodeGeneration /LTCG
100
              },
101
              'VCLibrarianTool': {
102
                'LinkTimeCodeGeneration': 'true',   # useLinkTimeCodeGeneration /LTCG
103
              },
104 105
            },
          },
106 107
        },
        'conditions' : [
108 109 110 111 112 113 114
          # Gyp's ninja generator depends on these specially named
          # configurations to build 64-bit on Windows.
          # See http://skbug.com/2348
          #
          # We handle the 64- vs 32-bit variations elsewhere, so I think it's
          # OK for us to just make these inherit non-archwidth-specific
          # configurations without modification.
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
          #
          # See http://skbug.com/2442 : These targets cause problems in the
          # MSVS build, so only include them if gyp is generating a ninja build.
          [ '"ninja" in "<!(echo %GYP_GENERATORS%)"', {
            'configurations': {
              'Debug_x64': {
                'inherit_from': ['Debug'],
              },
              'Release_x64': {
                'inherit_from': ['Release'],
              },
              'Release_Developer_x64': {
                'inherit_from': ['Release_Developer'],
              },
            },
          }],
131
          [ 'skia_arch_width == 64', {
132
            'msvs_configuration_platform': 'x64',
133 134 135 136 137
          }],
          [ 'skia_arch_width == 32', {
            'msvs_configuration_platform': 'Win32',
          }],
          [ 'skia_warnings_as_errors', {
138 139
            'msvs_settings': {
              'VCCLCompilerTool': {
140 141 142 143
                'WarnAsError': 'true',
                'AdditionalOptions': [
                  '/we4189', # initialized but unused var warning
                ],
144 145
              },
            },
146
          }],
147 148 149 150 151 152 153 154 155
          [ 'skia_win_exceptions', {
            'msvs_settings': {
              'VCCLCompilerTool': {
                'AdditionalOptions': [
                  '/EHsc',
                ],
              },
            },
          }],
156
        ],
157 158 159
      },
    ],

160 161 162
    # The following section is common to linux + derivatives and android
    [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos", "android"]',
      {
163
        'cflags': [
164
          '-g',
165 166
          '-fno-exceptions',
          '-fstrict-aliasing',
167

168 169 170 171 172 173 174 175 176 177 178
          '-Wall',
          '-Wextra',
          '-Winit-self',
          '-Wpointer-arith',

          '-Wno-unused-parameter',
        ],
        'cflags_cc': [
          '-fno-rtti',
          '-Wnon-virtual-dtor',
        ],
179
        'conditions': [
180 181 182 183 184 185
          [ 'skia_android_framework==0', {
            'cflags': [
              # This flag is not supported by Android build system.
              '-Wno-c++11-extensions',
            ],
          }],
186 187 188 189 190
          [ 'skia_warnings_as_errors', {
            'cflags': [
              '-Werror',
            ],
          }],
191 192 193 194 195 196 197 198 199
          # For profiling; reveals some costs, exaggerates others (e.g. trivial setters & getters).
          [ 'skia_disable_inlining', {
            'cflags': [
              '-fno-inline',
              '-fno-default-inline',
              '-finline-limit=0',
              '-fno-omit-frame-pointer',
            ],
          }],
200 201 202 203
          [ 'skia_arch_type == "arm" and arm_thumb == 1', {
            'cflags': [
              '-mthumb',
            ],
204 205 206 207 208 209 210 211 212 213 214 215 216
            # The --fix-cortex-a8 switch enables a link-time workaround for
            # an erratum in certain Cortex-A8 processors.  The workaround is
            # enabled by default if you target the ARM v7-A arch profile.
            # It can be enabled otherwise by specifying --fix-cortex-a8, or
            # disabled unconditionally by specifying --no-fix-cortex-a8.
            #
            # The erratum only affects Thumb-2 code.
            'conditions': [
              [ 'arm_version < 7', {
                'ldflags': [
                  '-Wl,--fix-cortex-a8',
                ],
              }],
217
            ],
218 219
          }],
          [ 'skia_arch_type == "arm" and arm_version >= 7', {
220 221 222
            'cflags': [
              '-march=armv7-a',
            ],
223 224 225
            'ldflags': [
              '-march=armv7-a',
            ],
226 227 228 229 230 231 232 233 234 235 236 237 238 239
            'conditions': [
              [ 'arm_neon == 1', {
                'defines': [
                  '__ARM_HAVE_NEON',
                ],
                'cflags': [
                  '-mfpu=neon',
                ],
              }],
              [ 'arm_neon_optional == 1', {
                'defines': [
                  '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
                ],
              }],
240 241 242 243 244
              [ 'skia_os != "chromeos"', {
                'cflags': [
                  '-mfloat-abi=softfp',
                ],
              }],
245 246 247 248 249 250
            ],
          }],
        ],
      },
    ],

251 252 253 254 255 256 257 258 259 260 261
    ['skia_android_framework', {
      'cflags': [
        # Skia does not enforce this usage pattern so we disable it here to avoid
        # unecessary log spew when building
        '-Wno-unused-parameter',

        # Android's -D_FORTIFY_SOURCE=2 extensions are incompatibile with SkString.
        # Revert to -D_FORTIFY_SOURCE=1
        '-U_FORTIFY_SOURCE',
        '-D_FORTIFY_SOURCE=1',
      ],
262 263 264 265 266 267
      # Remove flags which are either unnecessary or problematic for the
      # Android framework build. Many of these flags are removed simply because
      # they were not previously in the Android framework makefile, and we did
      # did not intend to add them when generating the makefile.
      # TODO (scroggo): Investigate whether any of these flags are actually
      # needed/would be beneficial.
268
      'cflags!': [
269 270
        # Android has one makefile, used for both debugging (after manual
        # modification) and release. Turn off debug info by default.
271 272 273 274 275
        '-g',
        '-march=armv7-a',
        '-mthumb',
        '-mfpu=neon',
        '-mfloat-abi=softfp',
276 277 278 279 280 281 282 283 284 285 286 287 288 289
        # This flag is not supported by Android build system.
        '-Wno-c++11-extensions',
        '-fno-exceptions',
        '-fstrict-aliasing',
        # Remove flags to turn on warnings, since most people building Android
        # are not focused on Skia and do not need the extra warning info.
        '-Wall',
        '-Wextra',
        '-Winit-self',
        '-Wpointer-arith',
      ],
      'cflags_cc!': [
        '-fno-rtti',
        '-Wnon-virtual-dtor',
290
      ],
291 292 293 294 295
      'defines': [
        'DCT_IFAST_SUPPORTED',
        # using freetype's embolden allows us to adjust fake bold settings at
        # draw-time, at which point we know which SkTypeface is being drawn
        'SK_USE_FREETYPE_EMBOLDEN',
296 297 298 299 300 301 302 303 304 305 306 307
        'SK_SFNTLY_SUBSETTER "sample/chromium/font_subsetter.h"',
        # When built as part of the system image we can enable certian non-NDK
        # compliant optimizations.
        'SK_BUILD_FOR_ANDROID_FRAMEWORK',
        # Optimizations for chromium (m30)
        'GR_GL_CUSTOM_SETUP_HEADER "gl/GrGLConfig_chrome.h"',
        'IGNORE_ROT_AA_RECT_OPT',
        # Disable this check because it is too strict for some chromium-specific
        # subclasses of SkPixelRef. See bug: crbug.com/171776.
        'SK_DISABLE_PIXELREF_LOCKCOUNT_BALANCE_CHECK',
        'SkLONGLONG int64_t',
        'SK_DEFAULT_FONT_CACHE_LIMIT   (768 * 1024)',
308
        'SK_ATOMICS_PLATFORM_H "../../src/ports/SkAtomics_sync.h"',
309
        'SK_MUTEX_PLATFORM_H "../../src/ports/SkMutex_pthread.h"',
310 311
        # Still need to switch Android to the new name for N32.
        'kNative_8888_SkColorType kN32_SkColorType',
312
        'SK_SUPPORT_LEGACY_PICTURE_CAN_RECORD',
313
        'SK_SUPPORT_DEPRECATED_RECORD_FLAGS',
314
        'SK_SUPPORT_LEGACY_DERIVED_PICTURE_CLASSES',
315
        'SK_SUPPORT_LEGACY_PICTURE_HEADERS',
316
        'SK_SUPPORT_LEGACY_BLURMASKFILTER_STYLE',
317 318
        # Needed until we fix skbug.com/2440.
        'SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG',
319 320
        # Transitional, for deprecated SkCanvas::SaveFlags methods.
        'SK_ATTR_DEPRECATED=SK_NOTHING_ARG1',
321
        'SK_SUPPORT_LEGACY_SHADER_LOCALMATRIX',
322 323
      ],
    }],
324

325
    [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos"]',
326 327 328 329 330 331
      {
        'defines': [
          'SK_SAMPLES_FOR_X',
          'SK_BUILD_FOR_UNIX',
        ],
        'configurations': {
332
          'Coverage': {
333
            'cflags': ['--coverage'],
334 335
            'ldflags': ['--coverage'],
          },
336 337 338
          'Debug': {
          },
          'Release': {
339 340 341
            'cflags': [
              '-O<(skia_release_optimization_level)',
            ],
342
            'defines': [ 'NDEBUG' ],
343 344
          },
        },
345
        'conditions' : [
346 347 348 349 350 351 352 353 354
          [ 'skia_shared_lib', {
            'cflags': [
              '-fPIC',
            ],
            'defines': [
              'SKIA_DLL',
              'SKIA_IMPLEMENTATION=1',
            ],
          }],
borenet@google.com's avatar
borenet@google.com committed
355 356 357 358
          [ 'skia_os == "nacl"', {
            'defines': [
              'SK_BUILD_FOR_NACL',
            ],
359
            'variables': {
360
              'nacl_sdk_root': '<!(echo ${NACL_SDK_ROOT})',
361
            },
borenet@google.com's avatar
borenet@google.com committed
362 363 364 365 366 367 368
            'link_settings': {
              'libraries': [
                '-lppapi',
                '-lppapi_cpp',
                '-lnosys',
                '-pthread',
              ],
369 370 371 372
              'ldflags': [
                '-L<(nacl_sdk_root)/lib/newlib_x86_<(skia_arch_width)/Release',
                '-L<(nacl_sdk_root)/ports/lib/newlib_x86_<(skia_arch_width)/Release',
              ],
borenet@google.com's avatar
borenet@google.com committed
373
            },
374 375 376 377 378 379 380
          }, { # skia_os != "nacl"
            'link_settings': {
              'ldflags': [
                '-lstdc++',
                '-lm',
              ],
            },
borenet@google.com's avatar
borenet@google.com committed
381
          }],
382
          [ 'skia_os != "chromeos"', {
383
            'conditions': [
384
              [ 'skia_arch_width == 64 and skia_arch_type == "x86"', {
385 386 387 388 389 390 391
                'cflags': [
                  '-m64',
                ],
                'ldflags': [
                  '-m64',
                ],
              }],
392
              [ 'skia_arch_width == 32 and skia_arch_type == "x86"', {
393 394 395 396 397 398 399 400 401
                'cflags': [
                  '-m32',
                ],
                'ldflags': [
                  '-m32',
                ],
              }],
            ],
          }],
402 403
          # Enable asan, tsan, etc.
          [ 'skia_sanitizer', {
borenet@google.com's avatar
borenet@google.com committed
404
            'cflags': [
405
              '-fsanitize=<(skia_sanitizer)',
borenet@google.com's avatar
borenet@google.com committed
406 407
            ],
            'ldflags': [
408
              '-fsanitize=<(skia_sanitizer)',
409
            ],
mtklein@google.com's avatar
mtklein@google.com committed
410 411 412
            'conditions' : [
              [ 'skia_sanitizer == "thread"', {
                'defines': [ 'DYNAMIC_ANNOTATIONS_ENABLED=1' ],
413
                'cflags': [ '-fPIC' ],
414 415 416 417 418 419
                'target_conditions': [
                  [ '_type == "executable"', {
                    'cflags': [ '-fPIE' ],
                    'ldflags': [ '-pie' ],
                  }],
                ],
mtklein@google.com's avatar
mtklein@google.com committed
420
              }],
commit-bot@chromium.org's avatar
commit-bot@chromium.org committed
421 422 423 424 425 426 427 428 429 430
              [ 'skia_sanitizer == "undefined"', {
                'cflags': [ '-fPIC' ],
                'cflags_cc!': ['-fno-rtti'],
                'target_conditions': [
                  [ '_type == "executable"', {
                    'cflags': [ '-fPIE' ],
                    'ldflags': [ '-pie' ],
                  }],
                ],
              }],
mtklein@google.com's avatar
mtklein@google.com committed
431
            ],
432
          }],
433 434
          [ 'skia_clang_build', {
            'cflags': [
435
              # Extra warnings we like but that only Clang knows about.
436 437
              '-Wstring-conversion',
            ],
438 439 440
            'cflags!': [
                '-mfpmath=sse',  # Clang doesn't need to be told this, and sometimes gets confused.
            ],
441
          }],
442 443 444
          [ 'skia_keep_frame_pointer', {
            'cflags': [ '-fno-omit-frame-pointer' ],
          }],
445 446 447 448
        ],
      },
    ],

449
    [ 'skia_os == "mac"',
450 451 452 453
      {
        'defines': [
          'SK_BUILD_FOR_MAC',
        ],
454
        'conditions' : [
455
          [ 'skia_arch_width == 64', {
456
            'xcode_settings': {
457
              'ARCHS': ['x86_64'],
458 459
            },
          }],
460
          [ 'skia_arch_width == 32', {
461
            'xcode_settings': {
462
              'ARCHS': ['i386'],
463 464 465 466
            },
          }],
          [ 'skia_warnings_as_errors', {
            'xcode_settings': {
humper@google.com's avatar
humper@google.com committed
467 468
              'OTHER_CPLUSPLUSFLAGS': [
                '-Werror',
469 470 471
                '-Wall',
                '-Wextra',
                '-Wno-unused-parameter',
472
                '-Wno-uninitialized',  # Disabled because we think GCC 4.2 is bad at this.
mtklein@google.com's avatar
mtklein@google.com committed
473 474 475
              ],
            },
          }],
476
        ],
477
        'configurations': {
478 479 480 481 482 483 484
          'Coverage': {
            'xcode_settings': {
               'GCC_OPTIMIZATION_LEVEL': '0',
               'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES',
               'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS' : 'YES',
            },
          },
485 486 487 488 489
          'Debug': {
            'xcode_settings': {
              'GCC_OPTIMIZATION_LEVEL': '0',
            },
          },
490 491
          'Release': {
            'xcode_settings': {
492
              'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)',
493
            },
494
            'defines': [ 'NDEBUG' ],
495
          },
496 497
        },
        'xcode_settings': {
498
          'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
499 500 501 502 503 504 505
          'conditions': [
            [ 'skia_osx_deployment_target==""', {
              'MACOSX_DEPLOYMENT_TARGET': '10.6', # -mmacos-version-min, passed in environment to ld.
            }, {
              'MACOSX_DEPLOYMENT_TARGET': '<(skia_osx_deployment_target)',
            }],
          ],
506 507
# trying to get this to work, but it needs clang I think...
#          'WARNING_CFLAGS': '-Wexit-time-destructors',
508
          'CLANG_WARN_CXX0X_EXTENSIONS': 'NO',
509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526
          'GCC_WARN_64_TO_32_BIT_CONVERSION': 'YES',
          'GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS': 'YES',
          'GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO': 'YES',
          'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES',
          'GCC_WARN_ABOUT_MISSING_PROTOTYPES': 'YES',
          'GCC_WARN_ABOUT_POINTER_SIGNEDNESS': 'YES',
          'GCC_WARN_ABOUT_RETURN_TYPE': 'YES',
          'GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL': 'YES',
          'GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED': 'YES',
          'GCC_WARN_MISSING_PARENTHESES': 'YES',
          'GCC_WARN_PROTOTYPE_CONVERSION': 'YES',
          'GCC_WARN_SIGN_COMPARE': 'YES',
          'GCC_WARN_TYPECHECK_CALLS_TO_PRINTF': 'YES',
          'GCC_WARN_UNKNOWN_PRAGMAS': 'YES',
          'GCC_WARN_UNUSED_FUNCTION': 'YES',
          'GCC_WARN_UNUSED_LABEL': 'YES',
          'GCC_WARN_UNUSED_VALUE': 'YES',
          'GCC_WARN_UNUSED_VARIABLE': 'YES',
527 528 529 530 531
          'OTHER_CPLUSPLUSFLAGS': [
            '-mssse3',
            '-fvisibility=hidden',
            '-fvisibility-inlines-hidden',
          ],
532 533 534 535
        },
      },
    ],

536
    [ 'skia_os == "ios"',
537 538 539 540
      {
        'defines': [
          'SK_BUILD_FOR_IOS',
        ],
541 542 543 544 545 546 547 548 549
        'conditions' : [
          [ 'skia_warnings_as_errors', {
            'xcode_settings': {
              'OTHER_CPLUSPLUSFLAGS': [
                '-Werror',
              ],
            },
          }],
        ],
550 551 552 553 554 555
        'configurations': {
          'Debug': {
            'xcode_settings': {
              'GCC_OPTIMIZATION_LEVEL': '0',
            },
          },
556 557
          'Release': {
            'xcode_settings': {
558
              'GCC_OPTIMIZATION_LEVEL': '<(skia_release_optimization_level)',
559 560 561
            },
            'defines': [ 'NDEBUG' ],
          },
562 563
        },
        'xcode_settings': {
564
          'ARCHS': ['armv7'],
565 566
          'CODE_SIGNING_REQUIRED': 'NO',
          'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
567
          'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)',
568
          'SDKROOT': 'iphoneos',
569
          'TARGETED_DEVICE_FAMILY': '1,2',
570 571 572 573
          'OTHER_CPLUSPLUSFLAGS': [
            '-fvisibility=hidden',
            '-fvisibility-inlines-hidden',
          ],
574
          'GCC_THUMB_SUPPORT': 'NO',
575 576 577
        },
      },
    ],
chudy@google.com's avatar
chudy@google.com committed
578

579
    [ 'skia_os == "android"',
580 581 582
      {
        'defines': [
          'SK_BUILD_FOR_ANDROID',
583
          'SK_FONTHOST_DOES_NOT_USE_FONTMGR',
584 585 586 587 588 589 590 591

          # Android Text Tuning
          'SK_GAMMA_EXPONENT=1.4',
          'SK_GAMMA_CONTRAST=0.0',
        ],
        # Android defines a fixed gamma exponent instead of using SRGB
        'defines!': [
          'SK_GAMMA_SRGB',
592
        ],
593 594 595 596 597 598 599 600 601
        'configurations': {
          'Debug': {
            'cflags': ['-g']
          },
          'Release': {
            'cflags': ['-O2'],
            'defines': [ 'NDEBUG' ],
          },
        },
602
        'libraries': [
603 604
          '-lstdc++',
          '-lm',
605
          '-llog',
606
        ],
607
        'cflags': [
608
          '-fuse-ld=gold',
609
        ],
610
        'conditions': [
611 612 613 614 615
          [ 'skia_android_framework', {
            'libraries!': [
              '-lstdc++',
              '-lm',
            ],
616 617 618
            'cflags!': [
              '-fuse-ld=gold',
            ],
619
          }],
620 621 622 623 624 625 626 627 628
          [ 'skia_shared_lib', {
            'cflags': [
              '-fPIC',
            ],
            'defines': [
              'SKIA_DLL',
              'SKIA_IMPLEMENTATION=1',
            ],
          }],
629 630
          [ 'skia_profile_enabled == 1', {
            'cflags': ['-g', '-fno-omit-frame-pointer', '-marm', '-mapcs'],
631
          }],
chudy@google.com's avatar
chudy@google.com committed
632
        ],
633 634
      },
    ],
635

636 637 638 639
    # We can POD-style initialization of static mutexes to avoid generating
    # static initializers if we're using a pthread-compatible thread interface.
    [ 'skia_os != "win"', {
      'defines': [
borenet@google.com's avatar
borenet@google.com committed
640
        'SK_USE_POSIX_THREADS',
641 642
      ],
    }],
commit-bot@chromium.org's avatar
commit-bot@chromium.org committed
643 644 645 646 647 648 649 650 651

    [ 'skia_moz2d', {
      'defines': [
        'SK_SUPPORT_LEGACY_LAYERRASTERIZER_API=1',
        'SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG=1',
        'SK_SUPPORT_LEGACY_GETTOTALCLIP=1',
      ],
    }],

652 653 654 655 656 657
    [ 'skia_build_json_writer', {
      'defines': [
        'SK_BUILD_JSON_WRITER',
      ]
    }],

658
  ], # end 'conditions'
659 660 661 662
  # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details
  'xcode_settings': {
    'SYMROOT': '<(DEPTH)/xcodebuild',
  },
663
}