Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / gyp / common_conditions.gypi
index ed54a58..d17965f 100644 (file)
@@ -8,6 +8,24 @@
     'SK_FORCE_DISTANCEFIELD_FONTS=<(skia_force_distancefield_fonts)',
   ],
   'conditions' : [
+    ['skia_pic', {
+     'cflags': [
+       '-fPIC',
+     ],
+     'conditions' : [
+      # FIXME: The reason we don't do this on Android is due to the way
+      # we build the executables/skia_launcher on Android. See
+      # https://codereview.chromium.org/406613003/diff/1/gyp/common_conditions.gypi#newcode455
+      ['skia_os != "android"', {
+       'target_conditions': [
+         [ '_type == "executable"', {
+           'cflags': [ '-fPIE' ],
+           'ldflags': [ '-pie' ],
+         }],
+       ],
+      }],
+     ],
+    }],
     [ 'skia_arch_type == "arm64"', {
       'cflags': [
         '-ffp-contract=off',
               'VCCLCompilerTool': {
                 'DebugInformationFormat': '3',      # programDatabase (/Zi)
                 'Optimization': '<(skia_release_optimization_level)',
-                'WholeProgramOptimization': 'true', #/GL
                # Changing the floating point model requires rebaseling gm images
                #'FloatingPointModel': '2',          # fast (/fp:fast)
                 'FavorSizeOrSpeed': '1',            # speed (/Ot)
               },
               'VCLinkerTool': {
                 'GenerateDebugInformation': 'true', # /DEBUG
-                'LinkTimeCodeGeneration': '1',      # useLinkTimeCodeGeneration /LTCG
-              },
-              'VCLibrarianTool': {
-                'LinkTimeCodeGeneration': 'true',   # useLinkTimeCodeGeneration /LTCG
               },
             },
           },
               },
             },
           }],
+          [ 'skia_win_ltcg', {
+            'configurations': {
+              'Release': {
+                'msvs_settings': {
+                  'VCCLCompilerTool': {
+                    'WholeProgramOptimization': 'true', #/GL
+                  },
+                  'VCLinkerTool': {
+                    'LinkTimeCodeGeneration': '1',      # useLinkTimeCodeGeneration /LTCG
+                  },
+                  'VCLibrarianTool': {
+                    'LinkTimeCodeGeneration': 'true',   # useLinkTimeCodeGeneration /LTCG
+                  },
+                },
+              },
+            },
+          }],
         ],
       },
     ],
           '-Winit-self',
           '-Wpointer-arith',
 
+          '-Wno-c++11-extensions',
           '-Wno-unused-parameter',
         ],
         'cflags_cc': [
           '-Wno-invalid-offsetof',  # GCC <4.6 is old-school strict about what is POD.
         ],
         'conditions': [
-          [ 'skia_android_framework==0', {
-            'cflags': [
-              # This flag is not supported by Android build system.
-              '-Wno-c++11-extensions',
+          [ 'skia_os != "chromeos"', {
+            'conditions': [
+              [ 'skia_arch_width == 64 and skia_arch_type == "x86"', {
+                'cflags': [
+                  '-m64',
+                ],
+                'ldflags': [
+                  '-m64',
+                ],
+              }],
+              [ 'skia_arch_width == 32 and skia_arch_type == "x86"', {
+                'cflags': [
+                  '-m32',
+                ],
+                'ldflags': [
+                  '-m32',
+                ],
+              }],
             ],
           }],
           [ 'skia_warnings_as_errors', {
             'conditions': [
               [ 'arm_neon == 1', {
                 'defines': [
-                  '__ARM_HAVE_NEON',
+                  'SK_ARM_HAS_NEON',
                 ],
                 'cflags': [
                   '-mfpu=neon',
               }],
               [ 'arm_neon_optional == 1', {
                 'defines': [
-                  '__ARM_HAVE_OPTIONAL_NEON_SUPPORT',
+                  'SK_ARM_HAS_OPTIONAL_NEON',
                 ],
               }],
               [ 'skia_os != "chromeos"', {
                     'cflags': [
                       '-mdsp',
                     ],
+                    'defines': [
+                      'SK_MIPS_HAS_DSP',
+                    ],
                   }],
                   [ 'mips_dsp == 2', {
                     'cflags': [
                       '-mdspr2',
                     ],
                     'defines': [
-                      '__MIPS_HAVE_DSPR2',
+                      'SK_MIPS_HAS_DSP',
+                      'SK_MIPS_HAS_DSPR2',
                     ],
                   }],
                 ],
         '-mthumb',
         '-mfpu=neon',
         '-mfloat-abi=softfp',
-        # 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
         # 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)',
-        'SK_ATOMICS_PLATFORM_H "../../src/ports/SkAtomics_sync.h"',
-        'SK_MUTEX_PLATFORM_H "../../src/ports/SkMutex_pthread.h"',
-        # Still need to switch Android to the new name for N32.
-        'kNative_8888_SkColorType kN32_SkColorType',
-        # Needed until we fix skbug.com/2440.
-        'SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG',
         # Transitional, for deprecated SkCanvas::SaveFlags methods.
         'SK_ATTR_DEPRECATED=SK_NOTHING_ARG1',
-        'SK_SUPPORT_LEGACY_SHADER_LOCALMATRIX',
         'SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)',
         'SK_IGNORE_ETC1_SUPPORT',
         # Defines from skia_for_android_framework_defines.gypi
         },
         'conditions' : [
           [ 'skia_shared_lib', {
-            'cflags': [
-              '-fPIC',
-            ],
             'defines': [
               'SKIA_DLL',
               'SKIA_IMPLEMENTATION=1',
                 '-L<(nacl_sdk_root)/ports/lib/newlib_x86_<(skia_arch_width)/Release',
               ],
             },
-          }, { # skia_os != "nacl"
-            'link_settings': {
-              'ldflags': [
-                '-lstdc++',
-                '-lm',
-              ],
-            },
-          }],
-          [ 'skia_os != "chromeos"', {
-            'conditions': [
-              [ 'skia_arch_width == 64 and skia_arch_type == "x86"', {
-                'cflags': [
-                  '-m64',
-                ],
-                'ldflags': [
-                  '-m64',
-                ],
-              }],
-              [ 'skia_arch_width == 32 and skia_arch_type == "x86"', {
-                'cflags': [
-                  '-m32',
-                ],
-                'ldflags': [
-                  '-m32',
-                ],
-              }],
-            ],
           }],
           # Enable asan, tsan, etc.
           [ 'skia_sanitizer', {
             ],
             'conditions' : [
               [ 'skia_sanitizer == "thread"', {
-                'defines': [ 'DYNAMIC_ANNOTATIONS_ENABLED=1' ],
-                'cflags': [ '-fPIC' ],
-                'target_conditions': [
-                  [ '_type == "executable"', {
-                    'cflags': [ '-fPIE' ],
-                    'ldflags': [ '-pie' ],
-                  }],
-                ],
+                'defines': [ 'SK_DYNAMIC_ANNOTATIONS_ENABLED=1' ],
               }],
               [ 'skia_sanitizer == "undefined"', {
-                'cflags': [ '-fPIC' ],
                 'cflags_cc!': ['-fno-rtti'],
-                'target_conditions': [
-                  [ '_type == "executable"', {
-                    'cflags': [ '-fPIE' ],
-                    'ldflags': [ '-pie' ],
-                  }],
-                ],
               }],
             ],
           }],
           [ 'skia_clang_build', {
+            'cflags_cc': [
+                # Build in C++11 mode to make sure we'll have an easy time switching.
+                '-std=c++11',
+                '-Wno-unknown-warning-option',  # Allows unknown warnings.
+                '-Wno-deprecated',              # From Qt, via debugger (older Clang).
+                '-Wno-deprecated-register',     # From Qt, via debugger (newer Clang).
+            ],
             'cflags': [
-              # Extra warnings we like but that only Clang knows about.
-              '-Wstring-conversion',
+                # Extra warnings we like but that only Clang knows about.
+                '-Wstring-conversion',
             ],
             'cflags!': [
                 '-mfpmath=sse',  # Clang doesn't need to be told this, and sometimes gets confused.
       {
         'defines': [
           'SK_BUILD_FOR_ANDROID',
-          'SK_FONTHOST_DOES_NOT_USE_FONTMGR',
 
           # Android Text Tuning
           'SK_GAMMA_EXPONENT=1.4',
           },
         },
         'libraries': [
-          '-lstdc++',
-          '-lm',
           '-llog',
         ],
         'cflags': [
           '-fuse-ld=gold',
         ],
         'conditions': [
-          [ 'skia_android_framework', {
-            'libraries!': [
-              '-lstdc++',
-              '-lm',
+          [ 'skia_arch_type == "x86"', {
+            'cflags': [
+              '-mssse3',
             ],
+          }],
+          [ 'skia_android_framework', {
             'cflags!': [
               '-fuse-ld=gold',
             ],
           }],
           [ 'skia_shared_lib', {
-            'cflags': [
-              '-fPIC',
-            ],
             'defines': [
               'SKIA_DLL',
               'SKIA_IMPLEMENTATION=1',
+              # Needed until we fix skbug.com/2440.
+              'SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG',
             ],
           }],
           [ 'skia_profile_enabled == 1', {
       ],
     }],
 
+    [ 'skia_is_bot', {
+      'defines': [ 'SK_CRASH_HANDLER' ],
+    }],
+
   ], # end 'conditions'
   # The Xcode SYMROOT must be at the root. See build/common.gypi in chromium for more details
   'xcode_settings': {