From 9381955a74a685979fc4f873de9684a7a791c0d3 Mon Sep 17 00:00:00 2001 From: "thakis@chromium.org" Date: Tue, 3 Apr 2012 21:15:21 +0000 Subject: Reduce duplication in third_party/zlib/zlib.gyp. Also, move the clang warning flags to the block that's shared for system / nonsystem zlib use. BUG=none TEST=fewer warnings when building with clang on linux NOTRY=true Review URL: http://codereview.chromium.org/9965119 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130459 0039d316-1c4b-4281-b951-d872f2087c98 --- third_party/zlib/zlib.gyp | 72 +++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 43 deletions(-) (limited to 'third_party/zlib') diff --git a/third_party/zlib/zlib.gyp b/third_party/zlib/zlib.gyp index 7e161da..4215f62 100644 --- a/third_party/zlib/zlib.gyp +++ b/third_party/zlib/zlib.gyp @@ -1,4 +1,4 @@ -# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -15,12 +15,12 @@ }], ], }, - 'conditions': [ - ['use_system_zlib==0', { - 'targets': [ - { - 'target_name': 'zlib', - 'type': 'static_library', + 'targets': [ + { + 'target_name': 'zlib', + 'type': 'static_library', + 'conditions': [ + ['use_system_zlib==0', { 'sources': [ 'contrib/minizip/ioapi.c', 'contrib/minizip/ioapi.h', @@ -71,33 +71,8 @@ 'contrib/minizip/iowin32.c' ], }], - ['OS=="mac" or os_bsd==1 or OS=="android"', { - # Mac, Android and the BSDs don't have fopen64, ftello64, or - # fseeko64. We use fopen, ftell, and fseek instead on these - # systems. - 'defines': [ - 'USE_FILE32API' - ], - }], - ['clang==1', { - 'xcode_settings': { - 'WARNING_CFLAGS': [ - # zlib uses `if ((a == b))` for some reason. - '-Wno-parentheses-equality', - ], - }, - 'cflags': [ - '-Wno-parentheses-equality', - ], - }], ], - }, - ], - }, { - 'targets': [ - { - 'target_name': 'zlib', - 'type': 'static_library', + }, { 'direct_dependent_settings': { 'defines': [ 'USE_SYSTEM_ZLIB', @@ -115,14 +90,6 @@ 'contrib/minizip/zip.h', ], 'conditions': [ - ['OS=="mac" or os_bsd==1 or OS=="android"', { - # Mac, Android and the BSDs don't have fopen64, ftello64, or - # fseeko64. We use fopen, ftell, and fseek instead on these - # systems. - 'defines': [ - 'USE_FILE32API' - ], - }], ['OS=="android"', { 'toolsets': ['target', 'host'], }], @@ -132,8 +99,27 @@ '-lz', ], }, - }, + }], + ['OS=="mac" or os_bsd==1 or OS=="android"', { + # Mac, Android and the BSDs don't have fopen64, ftello64, or + # fseeko64. We use fopen, ftell, and fseek instead on these + # systems. + 'defines': [ + 'USE_FILE32API' + ], + }], + ['clang==1', { + 'xcode_settings': { + 'WARNING_CFLAGS': [ + # zlib uses `if ((a == b))` for some reason. + '-Wno-parentheses-equality', + ], + }, + 'cflags': [ + '-Wno-parentheses-equality', + ], + }], ], - }], + } ], } -- cgit v1.1