# conditions used in both common.gypi and skia.gyp in chromium # { 'defines': [ 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=<(skia_static_initializers)', 'SK_SUPPORT_GPU=<(skia_gpu)', 'SK_SUPPORT_OPENCL=<(skia_opencl)', 'SK_DISTANCEFIELD_FONTS=<(skia_distancefield_fonts)', ], 'conditions' : [ [ 'skia_os == "win"', { 'defines': [ 'SK_BUILD_FOR_WIN32', '_CRT_SECURE_NO_WARNINGS', 'GR_GL_FUNCTION_TYPE=__stdcall', ], 'msvs_cygwin_shell': 0, 'msvs_settings': { 'VCCLCompilerTool': { 'WarningLevel': '3', 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb', 'DebugInformationFormat': '3', 'ExceptionHandling': '0', 'AdditionalOptions': [ '/MP', ], }, 'VCLinkerTool': { 'AdditionalDependencies': [ 'OpenGL32.lib', 'usp10.lib', # 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', 'DelayImp.lib', ], }, }, 'configurations': { 'Debug': { 'msvs_settings': { 'VCCLCompilerTool': { 'DebugInformationFormat': '4', # editAndContiue (/ZI) 'Optimization': '0', # optimizeDisabled (/Od) 'PreprocessorDefinitions': ['_DEBUG'], 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd) 'RuntimeTypeInfo': 'false', # /GR- }, 'VCLinkerTool': { 'GenerateDebugInformation': 'true', # /DEBUG 'LinkIncremental': '2', # /INCREMENTAL }, }, }, 'Release': { 'msvs_settings': { '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) 'PreprocessorDefinitions': ['NDEBUG'], 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD) 'EnableEnhancedInstructionSet': '2',# /arch:SSE2 'RuntimeTypeInfo': 'false', # /GR- }, 'VCLinkerTool': { 'GenerateDebugInformation': 'true', # /DEBUG 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG }, 'VCLibrarianTool': { 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG }, }, }, }, 'conditions' : [ [ 'skia_arch_width == 64', { 'msvs_configuration_platform': 'x64', }], [ 'skia_arch_width == 32', { 'msvs_configuration_platform': 'Win32', }], [ 'skia_warnings_as_errors', { 'msvs_settings': { 'VCCLCompilerTool': { 'WarnAsError': 'true', 'AdditionalOptions': [ '/we4189', # initialized but unused var warning ], }, }, }], [ 'skia_win_exceptions', { 'msvs_settings': { 'VCCLCompilerTool': { 'AdditionalOptions': [ '/EHsc', ], }, }, }], ], }, ], # The following section is common to linux + derivatives and android [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos", "android"]', { 'cflags': [ '-g', '-fno-exceptions', '-fstrict-aliasing', '-Wall', '-Wextra', '-Winit-self', '-Wpointer-arith', '-Wno-unused-parameter', ], 'cflags_cc': [ '-fno-rtti', '-Wnon-virtual-dtor', ], 'conditions': [ [ 'skia_android_framework==0', { 'cflags': [ # This flag is not supported by Android build system. '-Wno-c++11-extensions', ], }], [ 'skia_warnings_as_errors', { 'cflags': [ '-Werror', ], }], # 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', ], }], [ 'skia_arch_type == "arm" and arm_thumb == 1', { 'cflags': [ '-mthumb', ], # 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', ], }], ], }], [ 'skia_arch_type == "arm" and arm_version >= 7', { 'cflags': [ '-march=armv7-a', ], 'ldflags': [ '-march=armv7-a', ], 'conditions': [ [ 'arm_neon == 1', { 'defines': [ '__ARM_HAVE_NEON', ], 'cflags': [ '-mfpu=neon', ], }], [ 'arm_neon_optional == 1', { 'defines': [ '__ARM_HAVE_OPTIONAL_NEON_SUPPORT', ], }], [ 'skia_os != "chromeos"', { 'cflags': [ '-mfloat-abi=softfp', ], }], ], }], ], }, ], ['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', ], 'cflags!': [ '-g', '-march=armv7-a', '-mthumb', '-mfpu=neon', '-mfloat-abi=softfp', ], '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', # Android provides at least FreeType 2.4.0 at runtime. 'SK_FONTHOST_FREETYPE_RUNTIME_VERSION=0x020400', # Skia should not use dlopen on Android. 'SK_CAN_USE_DLOPEN=0', ], }], [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos"]', { 'defines': [ 'SK_SAMPLES_FOR_X', 'SK_BUILD_FOR_UNIX', ], 'configurations': { 'Coverage': { 'cflags': ['--coverage'], 'ldflags': ['--coverage'], }, 'Debug': { }, 'Release': { 'cflags': [ '-O<(skia_release_optimization_level)', ], 'defines': [ 'NDEBUG' ], }, }, 'conditions' : [ [ 'skia_shared_lib', { 'cflags': [ '-fPIC', ], 'defines': [ 'SKIA_DLL', 'SKIA_IMPLEMENTATION=1', ], }], [ 'skia_os == "nacl"', { 'defines': [ 'SK_BUILD_FOR_NACL', ], 'variables': { 'nacl_sdk_root': '