Clean up common.gypi.

This removes a handful of redundant variables and GYP includes.

BUG=
R=mark@chromium.org

Review URL: https://breakpad.appspot.com/2654002

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1321 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
chrisha@chromium.org 2014-04-28 21:16:52 +00:00
parent 3d023a3472
commit 4463365304
6 changed files with 55 additions and 353 deletions

View File

@ -31,34 +31,13 @@
# since gyp_chromium is automatically forcing its inclusion.
{
'variables': {
# .gyp files or targets should set chromium_code to 1 if they build
# Chromium-specific code, as opposed to external code. This variable is
# used to control such things as the set of warnings to enable, and
# whether warnings are treated as errors.
'chromium_code%': 0,
# Variables expected to be overriden on the GYP command line (-D) or by
# ~/.gyp/include.gypi.
# Putting a variables dict inside another variables dict looks kind of
# weird. This is done so that "branding" and "buildtype" are defined as
# variables within the outer variables dict here. This is necessary
# to get these variables defined for the conditions within this variables
# dict that operate on these variables.
# weird. This is necessary to get these variables defined for the conditions
# within this variables dict that operate on these variables.
'variables': {
# Override branding to select the desired branding flavor.
'branding%': 'Chromium',
# Override buildtype to select the desired build flavor.
# Dev - everyday build for development/testing
# Official - release build (generally implies additional processing)
# TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
# conversion is done), some of the things which are now controlled by
# 'branding', such as symbol generation, will need to be refactored based
# on 'buildtype' (i.e. we don't care about saving symbols for non-Official
# builds).
'buildtype%': 'Dev',
'variables': {
# Compute the architecture that we're building on.
'conditions': [
@ -72,49 +51,19 @@
'host_arch%': 'ia32',
}],
],
# Whether we're building a ChromeOS build. We set the initial
# value at this level of nesting so it's available for the
# toolkit_views test below.
'chromeos%': '0',
},
# Set default value of toolkit_views on for Windows and Chrome OS.
# We set it at this level of nesting so the value is available for
# other conditionals below.
'conditions': [
['OS=="win" or chromeos==1', {
'toolkit_views%': 1,
}, {
'toolkit_views%': 0,
}],
],
'host_arch%': '<(host_arch)',
# Default architecture we're building for is the architecture we're
# building on.
'target_arch%': '<(host_arch)',
# We do want to build Chromium with Breakpad support in certain
# situations. I.e. for Chrome bot.
'linux_chromium_breakpad%': 0,
# And if we want to dump symbols.
'linux_chromium_dump_symbols%': 0,
# Also see linux_strip_binary below.
# Copy conditionally-set chromeos variable out one scope.
'chromeos%': '<(chromeos)',
# This variable tells WebCore.gyp and JavaScriptCore.gyp whether they are
# are built under a chromium full build (1) or a webkit.org chromium
# build (0).
'inside_chromium_build%': 1,
# Set to 1 to enable fast builds. It disables debug info for fastest
# compilation.
'fastbuild%': 0,
# Set to 1 compile with -fPIC cflag on linux. This is a must for shared
# libraries on linux x86-64 and arm.
'linux_fpic%': 0,
@ -135,16 +84,9 @@
'disable_sse2%': 0,
},
# Define branding and buildtype on the basis of their settings within the
# variables sub-dict above, unless overridden.
'branding%': '<(branding)',
'buildtype%': '<(buildtype)',
'target_arch%': '<(target_arch)',
'host_arch%': '<(host_arch)',
'toolkit_views%': '<(toolkit_views)',
'chromeos%': '<(chromeos)',
'inside_chromium_build%': '<(inside_chromium_build)',
'fastbuild%': '<(fastbuild)',
'linux_fpic%': '<(linux_fpic)',
'python_ver%': '<(python_ver)',
'arm_version%': '<(arm_version)',
@ -267,55 +209,14 @@
'gcc_version%': '<!(python <(DEPTH)/build/compiler_version.py)',
# Figure out the python architecture to decide if we build pyauto.
'python_arch%': '<!(<(DEPTH)/build/linux/python_arch.sh <(sysroot)/usr/lib/libpython<(python_ver).so.1.0)',
'conditions': [
['branding=="Chrome" or linux_chromium_breakpad==1', {
'linux_breakpad%': 1,
}, {
'linux_breakpad%': 0,
}],
# All Chrome builds have breakpad symbols, but only process the
# symbols from official builds.
# TODO(mmoss) dump_syms segfaults on x64. Enable once dump_syms and
# crash server handle 64-bit symbols.
['linux_chromium_dump_symbols==1 or '
'(branding=="Chrome" and buildtype=="Official" and '
'target_arch=="ia32")', {
'linux_dump_symbols%': 1,
}, {
'linux_dump_symbols%': 0,
}],
['toolkit_views==0', {
# GTK wants Title Case strings
'use_titlecase_in_grd_files%': 1,
}],
],
'linux_breakpad%': 1,
'linux_dump_symbols%': 1,
}], # OS=="linux" or OS=="freebsd" or OS=="openbsd"
['OS=="mac"', {
# Mac wants Title Case strings
'use_titlecase_in_grd_files%': 1,
'conditions': [
# mac_product_name is set to the name of the .app bundle as it should
# appear on disk. This duplicates data from
# chrome/app/theme/chromium/BRANDING and
# chrome/app/theme/google_chrome/BRANDING, but is necessary to get
# these names into the build system.
['branding=="Chrome"', {
'mac_product_name%': 'Google Chrome',
}, { # else: branding!="Chrome"
'mac_product_name%': 'Chromium',
}],
# Feature variables for enabling Mac Breakpad and Keystone auto-update
# support. Both features are on by default in official builds with
# Chrome branding.
['branding=="Chrome" and buildtype=="Official"', {
'mac_breakpad%': 1,
'mac_keystone%': 1,
}, { # else: branding!="Chrome" or buildtype!="Official"
'mac_breakpad%': 0,
'mac_keystone%': 0,
}],
],
'mac_breakpad%': 0,
'mac_keystone%': 0,
}], # OS=="mac"
# Whether to use multiple cores to compile with visual studio. This is
# optional because it sometimes causes corruption on VS 2005.
@ -351,7 +252,7 @@
}],
# Compute based on OS, target architecture and device whether GLES
# is supported
[ 'OS=="linux" and target_arch=="arm" and chromeos==1', {
[ 'OS=="linux" and target_arch=="arm"', {
# Enable a variable used elsewhere throughout the GYP files to determine
# whether to compile in the sources for the GLES support.
'enable_gles%': 1,
@ -373,17 +274,6 @@
},
'target_defaults': {
'variables': {
# The condition that operates on chromium_code is in a target_conditions
# section, and will not have access to the default fallback value of
# chromium_code at the top of this file, or to the chromium_code
# variable placed at the root variables scope of .gyp files, because
# those variables are not set at target scope. As a workaround,
# if chromium_code is not set at target scope, define it in target scope
# to contain whatever value it has during early variable expansion.
# That's enough to make it available during target conditional
# processing.
'chromium_code%': '<(chromium_code)',
# See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
'mac_release_optimization%': '3', # Use -O3 unless overridden
'mac_debug_optimization%': '0', # Use -O0 unless overridden
@ -399,34 +289,6 @@
'release_valgrind_build%': 0,
},
'conditions': [
['branding=="Chrome"', {
'defines': ['GOOGLE_CHROME_BUILD'],
}, { # else: branding!="Chrome"
'defines': ['CHROMIUM_BUILD'],
}],
['toolkit_views==1', {
'defines': ['TOOLKIT_VIEWS=1'],
}],
['chromeos==1', {
'defines': ['OS_CHROMEOS=1'],
}],
['fastbuild!=0', {
'conditions': [
# Finally, for Windows, we simply turn on profiling.
['OS=="win"', {
'msvs_settings': {
'VCLinkerTool': {
'GenerateDebugInformation': 'false',
},
'VCCLCompilerTool': {
'DebugInformationFormat': '0',
}
}
}, { # else: OS != "win"
'cflags': [ '-g1' ],
}],
], # conditions for fastbuild.
}], # fastbuild!=0
['selinux==1', {
'defines': ['CHROMIUM_SELINUX=1'],
}],
@ -488,82 +350,32 @@
}], # coverage!=0
], # conditions for 'target_defaults'
'target_conditions': [
['chromium_code==0', {
'conditions': [
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
'cflags!': [
'-Wall',
'-Wextra',
'-Werror',
],
}],
[ 'OS=="win"', {
'defines': [
'_CRT_SECURE_NO_DEPRECATE',
'_CRT_NONSTDC_NO_WARNINGS',
'_CRT_NONSTDC_NO_DEPRECATE',
],
'msvs_disabled_warnings': [4800],
'msvs_settings': {
'VCCLCompilerTool': {
'WarnAsError': 'true',
'Detect64BitPortabilityProblems': 'false',
},
},
}],
[ 'OS=="mac"', {
'xcode_settings': {
'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
'WARNING_CFLAGS!': ['-Wall'],
},
}],
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
'cflags!': [
'-Wall',
'-Wextra',
'-Werror',
],
}, {
# In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
# C99 macros on Mac and Linux.
}],
[ 'OS=="win"', {
'defines': [
'__STDC_FORMAT_MACROS',
],
'conditions': [
['OS!="win"', {
'sources/': [ ['exclude', '_win(_unittest)?\\.cc$'],
['exclude', '/win/'],
['exclude', '/win_[^/]*\\.cc$'] ],
}],
['OS!="mac"', {
'sources/': [ ['exclude', '_(cocoa|mac)(_unittest)?\\.cc$'],
['exclude', '/(cocoa|mac)/'],
['exclude', '\.mm?$' ] ],
}],
['OS!="linux" and OS!="freebsd" and OS!="openbsd"', {
'sources/': [
['exclude', '_(chromeos|gtk|x|x11|xdg)(_unittest)?\\.cc$'],
['exclude', '/gtk/'],
['exclude', '/(gtk|x11)_[^/]*\\.cc$'],
],
}],
['OS!="linux"', {
'sources/': [
['exclude', '_linux(_unittest)?\\.cc$'],
['exclude', '/linux/'],
],
}],
# We use "POSIX" to refer to all non-Windows operating systems.
['OS=="win"', {
'sources/': [ ['exclude', '_posix\\.cc$'] ],
}],
# Though Skia is conceptually shared by Linux and Windows,
# the only _skia files in our tree are Linux-specific.
['OS!="linux" and OS!="freebsd" and OS!="openbsd"', {
'sources/': [ ['exclude', '_skia\\.cc$'] ],
}],
['chromeos!=1', {
'sources/': [ ['exclude', '_chromeos\\.cc$'] ]
}],
['toolkit_views==0', {
'sources/': [ ['exclude', '_views\\.cc$'] ]
}],
'_CRT_SECURE_NO_DEPRECATE',
'_CRT_NONSTDC_NO_WARNINGS',
'_CRT_NONSTDC_NO_DEPRECATE',
],
'msvs_disabled_warnings': [4800],
'msvs_settings': {
'VCCLCompilerTool': {
'WarnAsError': 'true',
'Detect64BitPortabilityProblems': 'false',
},
},
}],
[ 'OS=="mac"', {
'xcode_settings': {
'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
'WARNING_CFLAGS!': ['-Wall'],
},
}],
], # target_conditions for 'target_defaults'
'default_configuration': 'Debug',
@ -714,7 +526,30 @@
'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
'conditions': [
['msvs_use_common_release', {
'includes': ['release.gypi'],
'defines': ['OFFICIAL_BUILD'],
'msvs_settings': {
'VCCLCompilerTool': {
'Optimization': '3',
'StringPooling': 'true',
'OmitFramePointers': 'true',
'InlineFunctionExpansion': '2',
'EnableIntrinsicFunctions': 'true',
'FavorSizeOrSpeed': '2',
'OmitFramePointers': 'true',
'EnableFiberSafeOptimizations': 'true',
'WholeProgramOptimization': 'true',
},
'VCLibrarianTool': {
'AdditionalOptions': ['/ltcg', '/expectedoutputsize:120000000'],
},
'VCLinkerTool': {
'LinkIncremental': '1',
'OptimizeReferences': '2',
'EnableCOMDATFolding': '2',
'OptimizeForWindows98': '1',
'LinkTimeCodeGeneration': '1',
},
},
}],
]
},
@ -931,22 +766,13 @@
# compiler optimized the code, since the value is always kept
# in its specified precision.
'conditions': [
['branding=="Chromium" and disable_sse2==0', {
['disable_sse2==0', {
'cflags': [
'-march=pentium4',
'-msse2',
'-mfpmath=sse',
],
}],
# ChromeOS targets Pinetrail, which is sse3, but most of the
# benefit comes from sse2 so this setting allows ChromeOS
# to build on other CPUs. In the future -march=atom would help
# but requires a newer compiler.
['chromeos==1 and disable_sse2==0', {
'cflags': [
'-msse2',
],
}],
],
# -mmmx allows mmintrin.h to be used for mmx intrinsics.
# video playback is mmx and sse2 optimized.
@ -1022,9 +848,6 @@
'cflags': [ '-gstabs' ],
'defines': ['USE_LINUX_BREAKPAD'],
}],
['linux_use_seccomp_sandbox==1 and buildtype!="Official"', {
'defines': ['USE_SECCOMP_SANDBOX'],
}],
['library=="shared_library"', {
# When building with shared libraries, remove the visiblity-hiding
# flag.

View File

@ -1,64 +0,0 @@
# Copyright 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
'conditions': [
[ 'OS=="linux"', {
'target_defaults': {
'cflags!': [
'-Wall',
'-Werror',
],
},
}],
[ 'OS=="win"', {
'target_defaults': {
'defines': [
'_CRT_SECURE_NO_DEPRECATE',
'_CRT_NONSTDC_NO_WARNINGS',
'_CRT_NONSTDC_NO_DEPRECATE',
],
'msvs_disabled_warnings': [4800],
'msvs_settings': {
'VCCLCompilerTool': {
'WarnAsError': 'false',
'Detect64BitPortabilityProblems': 'false',
},
},
},
}],
[ 'OS=="mac"', {
'target_defaults': {
'xcode_settings': {
'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
'WARNING_CFLAGS!': ['-Wall'],
},
},
}],
],
}

View File

@ -1,15 +0,0 @@
{
'msvs_settings': {
'VCCLCompilerTool': {
'Optimization': '2',
'StringPooling': 'true',
'OmitFramePointers': 'true',
},
'VCLinkerTool': {
'LinkIncremental': '1',
'OptimizeReferences': '2',
'EnableCOMDATFolding': '2',
'OptimizeForWindows98': '1',
},
},
}

View File

@ -1,3 +0,0 @@
{
'includes': ['release_defaults.gypi'],
}

View File

@ -1,21 +0,0 @@
{
'includes': ['release_defaults.gypi'],
'defines': ['OFFICIAL_BUILD'],
'msvs_settings': {
'VCCLCompilerTool': {
'Optimization': '3',
'InlineFunctionExpansion': '2',
'EnableIntrinsicFunctions': 'true',
'FavorSizeOrSpeed': '2',
'OmitFramePointers': 'true',
'EnableFiberSafeOptimizations': 'true',
'WholeProgramOptimization': 'true',
},
'VCLibrarianTool': {
'AdditionalOptions': ['/ltcg', '/expectedoutputsize:120000000'],
},
'VCLinkerTool': {
'LinkTimeCodeGeneration': '1',
},
},
}

View File

@ -1,18 +0,0 @@
{
'conditions': [
# Handle build types.
['buildtype=="Dev"', {
'includes': ['internal/release_impl.gypi'],
}],
['buildtype=="Official"', {
'includes': ['internal/release_impl_official.gypi'],
}],
# TODO(bradnelson): may also need:
# checksenabled
# coverage
# dom_stats
# pgo_instrument
# pgo_optimize
# purify
],
}