aboutsummaryrefslogtreecommitdiffhomepage
path: root/gyp
diff options
context:
space:
mode:
authorGravatar borenet@google.com <borenet@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-22 13:16:06 +0000
committerGravatar borenet@google.com <borenet@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-22 13:16:06 +0000
commita72aef8a21c095d7502385f965ad510c775a9377 (patch)
treec25a3a512a9a1c10fab91071a8730a9e7cdeb1cb /gyp
parenta3a09ab1d5e8ecc6f16b14610f9dd74be569cc29 (diff)
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
Diffstat (limited to 'gyp')
-rw-r--r--gyp/angle.gyp2
-rw-r--r--gyp/cityhash.gyp33
-rw-r--r--gyp/common_conditions.gypi86
-rw-r--r--gyp/common_variables.gypi14
-rw-r--r--gyp/jsoncpp.gyp23
-rw-r--r--gyp/libjpeg.gyp15
-rw-r--r--gyp/utils.gyp50
7 files changed, 91 insertions, 132 deletions
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%': '<!(python <(DEPTH)/tools/find_mac_sdk.py 10.6)',
@@ -198,14 +176,18 @@
'SK_BUILD_FOR_MAC',
],
'conditions' : [
- ['skia_arch_width == 64', {
+ [ 'skia_arch_width == 64', {
'xcode_settings': {
'ARCHS': 'x86_64',
},
}],
- ['skia_arch_width == 32', {
+ [ 'skia_arch_width == 32', {
'xcode_settings': {
'ARCHS': 'i386',
+ },
+ }],
+ [ 'skia_warnings_as_errors', {
+ 'xcode_settings': {
'OTHER_CPLUSPLUSFLAGS': [
'-Werror',
],
@@ -228,7 +210,7 @@
'xcode_settings': {
'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
'conditions': [
- ['skia_osx_sdkroot==""', {
+ [ 'skia_osx_sdkroot==""', {
'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
}, {
'SDKROOT': '<(skia_osx_sdkroot)', # -isysroot
@@ -264,11 +246,20 @@
},
],
- ['skia_os == "ios"',
+ [ 'skia_os == "ios"',
{
'defines': [
'SK_BUILD_FOR_IOS',
],
+ 'conditions' : [
+ [ 'skia_warnings_as_errors', {
+ 'xcode_settings': {
+ 'OTHER_CPLUSPLUSFLAGS': [
+ '-Werror',
+ ],
+ },
+ }],
+ ],
'configurations': {
'Debug': {
'xcode_settings': {
@@ -289,13 +280,16 @@
'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_sdk_version)',
'SDKROOT': 'iphoneos',
'TARGETED_DEVICE_FAMILY': '1,2',
- 'OTHER_CPLUSPLUSFLAGS': '-fvisibility=hidden -fvisibility-inlines-hidden',
+ 'OTHER_CPLUSPLUSFLAGS': [
+ '-fvisibility=hidden',
+ '-fvisibility-inlines-hidden',
+ ],
'GCC_THUMB_SUPPORT': 'NO',
},
},
],
- ['skia_os == "android"',
+ [ 'skia_os == "android"',
{
'defines': [
'SK_BUILD_FOR_ANDROID',
@@ -322,7 +316,7 @@
'-fuse-ld=gold',
],
'conditions': [
- [ 'skia_warnings_as_errors == 1', {
+ [ 'skia_warnings_as_errors', {
'cflags': [
'-Werror',
],
diff --git a/gyp/common_variables.gypi b/gyp/common_variables.gypi
index 8ddbbb46e6..4f9f5422c4 100644
--- a/gyp/common_variables.gypi
+++ b/gyp/common_variables.gypi
@@ -89,12 +89,19 @@
'skia_gpu%': 1,
'skia_osx_sdkroot%': '',
'skia_profile_enabled%': 0,
- # Note: This is currently only turned on for linux and android.
- # TODO: Turn on for Win and Mac as well.
- 'skia_warnings_as_errors%': 0,
'skia_win_debuggers_path%': '',
},
+ 'conditions': [
+ [ 'skia_os == "win" and skia_arch_width == 32 or '
+ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "android"] or '
+ 'skia_os == "mac" and skia_arch_width == 32', {
+ 'skia_warnings_as_errors%': 1,
+ }, {
+ 'skia_warnings_as_errors%': 0,
+ }],
+ ],
+
# Re-define all variables defined within the level-2 'variables' dict,
# so that siblings of the level-1 'variables' dict can see them.
'armv7%': '<(armv7)',
@@ -114,7 +121,6 @@
'skia_gpu%': '<(skia_gpu)',
'skia_osx_sdkroot%': '<(skia_osx_sdkroot)',
'skia_profile_enabled%': '<(skia_profile_enabled)',
- 'skia_warnings_as_errors%': '<(skia_warnings_as_errors)',
'skia_static_initializers%': '<(skia_static_initializers)',
'ios_sdk_version%': '6.0',
'skia_win_debuggers_path%': '<(skia_win_debuggers_path)',
diff --git a/gyp/jsoncpp.gyp b/gyp/jsoncpp.gyp
index 254963999d..ab00db9cc1 100644
--- a/gyp/jsoncpp.gyp
+++ b/gyp/jsoncpp.gyp
@@ -12,6 +12,9 @@
# and https://code.google.com/p/skia/source/detail?r=7115
{
+ 'variables': {
+ 'skia_warnings_as_errors': 0,
+ },
'targets': [
{
'target_name': 'jsoncpp',
@@ -47,29 +50,9 @@
],
},
'conditions': [
- [ 'skia_os == "mac"', {
- 'xcode_settings': {
- 'OTHER_CPLUSPLUSFLAGS!': [
- '-Werror',
- ]
- },
- }],
- [ 'skia_os == "win"', {
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'WarnAsError': 'false',
- },
- },
- }],
[ 'skia_os == "android"', {
'cflags!': [
'-Wall',
- '-Werror',
- ],
- }],
- ['skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl"]', {
- 'cflags!': [
- '-Werror',
],
}],
],
diff --git a/gyp/libjpeg.gyp b/gyp/libjpeg.gyp
index f6683101ce..da2b9deadb 100644
--- a/gyp/libjpeg.gyp
+++ b/gyp/libjpeg.gyp
@@ -11,6 +11,7 @@
{
'variables': {
'use_system_libjpeg%': 0,
+ 'skia_warnings_as_errors': 0,
},
'conditions': [
['skia_os == "android"', {
@@ -95,24 +96,12 @@
],
},
'conditions': [
- ['OS!="win"', {
+ [ 'skia_os != "win"', {
'product_name': 'jpeg',
'cflags': [
'-Wno-main', # supresses warnings about naming things "main"
],
}],
- ['OS=="android"', {
- 'cflags!': [
- '-fno-rtti', # supresses warnings about invalid option of non-C++ code
- '-Wall',
- '-Werror',
- ],
- }],
- ['OS in ["linux", "freebsd", "openbsd", "solaris", "nacl"]', {
- 'cflags!': [
- '-Werror',
- ],
- }],
],
},
],
diff --git a/gyp/utils.gyp b/gyp/utils.gyp
index f98e6fc9ce..00481112ee 100644
--- a/gyp/utils.gyp
+++ b/gyp/utils.gyp
@@ -6,7 +6,7 @@
'type': 'static_library',
'standalone_static_library': 1,
'dependencies': [
- 'cityhash',
+ 'cityhash.gyp:cityhash',
],
'include_dirs': [
'../include/config',
@@ -204,7 +204,7 @@
# missing byteswap.h which is needed by CityHash.
# TODO(borenet): Find a way to either provide this dependency or
# replace it.
- 'cityhash',
+ 'cityhash.gyp:cityhash',
],
}],
[ 'skia_os == "android"', {
@@ -219,52 +219,6 @@
],
},
},
- {
- '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 == "mac"', {
- 'xcode_settings': {
- 'OTHER_CPLUSPLUSFLAGS!': [
- '-Werror',
- ]
- },
- }],
- [ 'skia_os == "win"', {
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'WarnAsError': 'false',
- },
- },
- }],
- [ 'skia_os == "android"', {
- 'cflags!': [
- '-Wall',
- '-Werror',
- ],
- }],
- ['skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl"]', {
- 'cflags!': [
- '-Werror',
- ],
- }],
- ],
- },
],
}