From a72aef8a21c095d7502385f965ad510c775a9377 Mon Sep 17 00:00:00 2001 From: "borenet@google.com" Date: Fri, 22 Mar 2013 13:16:06 +0000 Subject: Refactor skia_warnings_as_errors Review URL: https://codereview.chromium.org/12963002 git-svn-id: http://skia.googlecode.com/svn/trunk@8330 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gyp/angle.gyp | 2 +- gyp/cityhash.gyp | 33 ++++++++++++++++++ gyp/common_conditions.gypi | 86 +++++++++++++++++++++------------------------- gyp/common_variables.gypi | 14 +++++--- gyp/jsoncpp.gyp | 23 ++----------- gyp/libjpeg.gyp | 15 ++------ gyp/utils.gyp | 50 ++------------------------- 7 files changed, 91 insertions(+), 132 deletions(-) create mode 100644 gyp/cityhash.gyp (limited to 'gyp') diff --git a/gyp/angle.gyp b/gyp/angle.gyp index 088895b97b..2a88d56b60 100644 --- a/gyp/angle.gyp +++ b/gyp/angle.gyp @@ -10,7 +10,7 @@ }, 'variables': { 'component': 'static_library', - 'skia_building_angle': 1, # See comment in common_conditions.gypi. + 'skia_warnings_as_errors': 0, }, 'includes': [ '../third_party/externals/angle/src/build_angle.gypi', diff --git a/gyp/cityhash.gyp b/gyp/cityhash.gyp new file mode 100644 index 0000000000..f35f1f02d3 --- /dev/null +++ b/gyp/cityhash.gyp @@ -0,0 +1,33 @@ +{ + 'variables': { + 'skia_warnings_as_errors': 0, + }, + 'targets': [ + { + 'target_name': 'cityhash', + 'type': 'static_library', + 'standalone_static_library': 1, + 'include_dirs': [ + '../include/config', + '../include/core', + '../src/utils/cityhash', + '../third_party/externals/cityhash/src', + ], + 'sources': [ + '../third_party/externals/cityhash/src/city.cc', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + '../third_party/externals/cityhash/src', + ], + }, + 'conditions': [ + [ 'skia_os == "android"', { + 'cflags!': [ + '-Wall', + ], + }], + ], + }, + ], +} diff --git a/gyp/common_conditions.gypi b/gyp/common_conditions.gypi index 2c7b16bc0d..360fed7e4c 100644 --- a/gyp/common_conditions.gypi +++ b/gyp/common_conditions.gypi @@ -6,7 +6,7 @@ # 'SK_SUPPORT_HINTING_SCALE_FACTOR', ], 'conditions' : [ - ['skia_gpu == 1', + [ 'skia_gpu == 1', { 'defines': [ 'SK_SUPPORT_GPU=1', @@ -17,7 +17,7 @@ ], }, ], - ['skia_os == "win"', + [ 'skia_os == "win"', { 'defines': [ 'SK_BUILD_FOR_WIN32', @@ -82,48 +82,27 @@ }, }, 'conditions' : [ - ['skia_arch_width == 64', { + [ 'skia_arch_width == 64', { 'msvs_configuration_platform': 'x64', + }], + [ 'skia_arch_width == 32', { + 'msvs_configuration_platform': 'Win32', + }], + [ 'skia_warnings_as_errors', { 'msvs_settings': { 'VCCLCompilerTool': { - 'WarnAsError': 'false', + 'WarnAsError': 'true', + 'AdditionalOptions': [ + '/we4189', # initialized but unused var warning + ], }, }, }], - ['skia_arch_width == 32', { - # This gypi file will be included directly into the gyp(i) files in the angle repo by - # our gyp_skia script. We don't want force WarnAsError on angle. So angle.gyp defines - # skia_building_angle=1 and here we select whether to enable WarnAsError based on that - # var's value. Here it defaults to 0. - 'variables' : { - 'skia_building_angle%': 0, - }, - 'conditions' : [ - ['skia_building_angle', { - 'msvs_configuration_platform': 'Win32', - 'msvs_settings': { - 'VCCLCompilerTool': { - 'WarnAsError': 'false', - }, - }, - },{ # not angle - 'msvs_configuration_platform': 'Win32', - 'msvs_settings': { - 'VCCLCompilerTool': { - 'WarnAsError': 'true', - 'AdditionalOptions': [ - '/we4189', # initialized but unused var warning - ], - }, - }, - }], - ], - }], ], }, ], - ['skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl"]', + [ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl"]', { 'defines': [ 'SK_SAMPLES_FOR_X', @@ -139,7 +118,6 @@ }, }, 'cflags': [ - '-Werror', '-Wall', '-Wextra', # suppressions below here were added for clang @@ -147,12 +125,12 @@ '-Wno-c++11-extensions' ], 'conditions' : [ - ['skia_warnings_as_errors == 1', { + [ 'skia_warnings_as_errors', { 'cflags': [ '-Werror', ], }], - ['skia_arch_width == 64', { + [ 'skia_arch_width == 64', { 'cflags': [ '-m64', ], @@ -160,7 +138,7 @@ '-m64', ], }], - ['skia_arch_width == 32', { + [ 'skia_arch_width == 32', { 'cflags': [ '-m32', ], @@ -189,7 +167,7 @@ }, ], - ['skia_os == "mac"', + [ 'skia_os == "mac"', { 'variables': { 'mac_sdk%': '