# conditions used in both common.gypi and skia.gyp in chromium # { 'defines': [ 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=<(skia_static_initializers)', # 'SK_SUPPORT_HINTING_SCALE_FACTOR', ], 'conditions' : [ [ 'skia_gpu == 1', { 'defines': [ 'SK_SUPPORT_GPU=1', ], }, { 'defines': [ 'SK_SUPPORT_GPU=0', ], }, ], [ 'skia_opencl == 1', { 'defines': [ 'SK_SUPPORT_OPENCL=1', ], }, { 'defines': [ 'SK_SUPPORT_OPENCL=0', ], }, ], [ 'skia_os == "win"', { 'defines': [ 'SK_BUILD_FOR_WIN32', 'SK_IGNORE_STDINT_DOT_H', '_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"]', { 'conditions': [ [ 'skia_warnings_as_errors', { 'cflags': [ '-Werror', ], }], [ 'skia_arch_type == "arm" and arm_thumb == 1', { 'cflags': [ '-mthumb', ], }], [ 'skia_arch_type == "arm" and armv7 == 1', { 'variables': { 'arm_neon_optional%': 0, }, 'defines': [ '__ARM_ARCH__=7', ], 'cflags': [ '-march=armv7-a', ], 'conditions': [ [ 'arm_neon == 1', { 'defines': [ '__ARM_HAVE_NEON', ], 'cflags': [ '-mfpu=neon', ], 'ldflags': [ '-march=armv7-a', '-Wl,--fix-cortex-a8', ], }], [ 'arm_neon_optional == 1', { 'defines': [ '__ARM_HAVE_OPTIONAL_NEON_SUPPORT', ], }], [ 'skia_os != "chromeos"', { 'cflags': [ '-mfloat-abi=softfp', ], }], ], }], ], }, ], [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl", "chromeos"]', { 'defines': [ 'SK_SAMPLES_FOR_X', 'SK_BUILD_FOR_UNIX', ], 'configurations': { 'Debug': { 'cflags': ['-g'] }, 'Release': { 'cflags': [ '-O<(skia_release_optimization_level)', '-g', ], 'defines': [ 'NDEBUG' ], }, }, 'cflags': [ '-Wall', '-Wextra', # suppressions below here were added for clang '-Wno-unused-parameter', '-Wno-c++11-extensions' ], 'conditions' : [ [ 'skia_shared_lib', { 'cflags': [ '-fPIC', ], 'defines': [ 'GR_DLL=1', 'GR_IMPLEMENTATION=1', 'SKIA_DLL', 'SKIA_IMPLEMENTATION=1', ], }], [ 'skia_os == "nacl"', { 'defines': [ 'SK_BUILD_FOR_NACL', ], 'link_settings': { 'libraries': [ '-lppapi', '-lppapi_cpp', '-lnosys', '-pthread', ], }, }, { # skia_os != "nacl" 'include_dirs' : [ '/usr/include/freetype2', ], }], [ 'skia_os == "chromeos"', { 'ldflags': [ '-lstdc++', '-lm', ], }, { '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_asan_build', { 'cflags': [ '-fsanitize=address', '-fno-omit-frame-pointer', ], 'ldflags': [ '-fsanitize=address', ], }], ], }, ], [ 'skia_os == "mac"', { 'variables': { 'mac_sdk%': '