Skip to content

Commit

Permalink
Force inclusion of build/common.gypi for all chromium gyp files.
Browse files Browse the repository at this point in the history
Why: Simpler build code. If everybody includes it, it should be included automatically.
Why now: The webkit chromium builds need it be specified, since can't default to build/common.gypi.

What was done:
1. build/common.gypi's contents were moved to a new file build/gyp_chromium.gypi
2. tools/gyp/gyp_chromium was moved to build/gyp_chromium and made to automatically include build/gyp_chromium.gypi.
3. lots of gyp files were fixed to not refer to build/common.gypi any more.
4. o3d which also builds independently of chrome, was fixed to have a gyp_o3d that includes gyp_chromium.gypi too.
5. build/common.gypi was left empty, because there are some external projects that still refer to it.

Things that are left to do after this patch is in:
1. The following external files (in other repositories) need to stop include common.gypi
  ./third_party/hunspell/hunspell.gyp
  ./third_party/icu/icu.gyp
  ./v8/tools/gyp/v8.gyp
2. Once nobody refers to common.gypi anymore, delete common.gypi
   -or-
   Delete gyp_chromium.gypi and move its content back to common.gypi

Tested on mac, win and linux. On win, got a few unit tests errors on chrome bookmarks, which should not be related. I'm running again with clobber to verify.

Review URL: http://codereview.chromium.org/206006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26302 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
yaar@chromium.org committed Sep 15, 2009
1 parent cd05e24 commit 21642ab
Show file tree
Hide file tree
Showing 62 changed files with 80 additions and 180 deletions.
10 changes: 5 additions & 5 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ deps = {
"/trunk/deps/third_party/WebKit@20601",

"src/third_party/icu":
"/trunk/deps/third_party/icu42@25717",
"/trunk/deps/third_party/icu42@26240",

"src/third_party/hunspell":
"/trunk/deps/third_party/hunspell128@25906",
"/trunk/deps/third_party/hunspell128@26238",

"src/third_party/protobuf2/src":
"http://protobuf.googlecode.com/svn/trunk@219",
Expand All @@ -36,7 +36,7 @@ deps = {
"http://gyp.googlecode.com/svn/trunk@651",

"src/v8":
"http://v8.googlecode.com/svn/trunk@2891",
"http://v8.googlecode.com/svn/trunk@2896",

"src/native_client":
"http://nativeclient.googlecode.com/svn/trunk/src/native_client@385",
Expand Down Expand Up @@ -156,8 +156,8 @@ skip_child_includes = [
hooks = [
{
# A change to a .gyp, .gypi, or to GYP itself shound run the generator.
"pattern": "\\.gypi?$|[/\\\\]src[/\\\\]tools[/\\\\]gyp[/\\\\]",
"action": ["python", "src/tools/gyp/gyp_chromium"],
"pattern": "\\.gypi?$|[/\\\\]src[/\\\\]tools[/\\\\]gyp[/\\\\]|[/\\\\]src[/\\\\]build[/\\\\]gyp_chromium$",
"action": ["python", "src/build/gyp_chromium"],
},
{
# Workaround IncrediBuild problem. http://crbug.com/17706.
Expand Down
3 changes: 0 additions & 3 deletions app/app.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
'variables': {
'chromium_code': 1,
},
'includes': [
'../build/common.gypi',
],
'target_defaults': {
'sources/': [
['exclude', '/(cocoa|gtk|win)/'],
Expand Down
3 changes: 0 additions & 3 deletions base/base.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
'variables': {
'chromium_code': 1,
},
'includes': [
'../build/common.gypi',
],
'targets': [
{
'target_name': 'base',
Expand Down
3 changes: 0 additions & 3 deletions breakpad/breakpad.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# found in the LICENSE file.

{
'includes': [
'../build/common.gypi',
],
'conditions': [
[ 'OS=="mac"', {
'target_defaults': {
Expand Down
3 changes: 0 additions & 3 deletions build/all.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# found in the LICENSE file.

{
'includes': [
'common.gypi',
],
'targets': [
{
'target_name': 'All',
Expand Down
3 changes: 3 additions & 0 deletions build/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# IMPORTANT:
# Please don't directly include this file if you are building via gyp_chromium,
# since gyp_chromium is automatically forcing its inclusion.
{
'variables': {
# .gyp files should set chromium_code to 1 if they build Chromium-specific
Expand Down
37 changes: 37 additions & 0 deletions build/gyp_chromium
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/python

# This script is wrapper for Chromium that adds some support for how GYP
# is invoked by Chromium beyond what can be done it the gclient hooks.

import glob
import os
import shlex
import sys

print 'Updating projects from gyp files...'

try:
import gyp
except ImportError, e:
sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '../tools/gyp/pylib'))
import gyp

if __name__ == '__main__':
args = sys.argv[1:]

# If we didn't get a file, check an env var, and then fall back to
# assuming 'src/build/all.gyp'
if len(args) == 0:
args += shlex.split(os.environ.get('CHROMIUM_GYP_FILE',
'src/build/all.gyp'))

# Always include gyp_chromium.gypi
args += ['-I', os.path.join(os.path.dirname(sys.argv[0]),'common.gypi')]

# Optionally add supplemental .gypi files if present.
supplements = glob.glob('src/*/supplement.gypi')
for supplement in supplements:
args += ['-I', supplement]

# Off we go...
sys.exit(gyp.main(args))
20 changes: 10 additions & 10 deletions build/linux/system.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
# found in the LICENSE file.

{
'variables' : {
'includes': [
'../common.gypi',
],
'conditions': [
['sysroot!=""', {
'conditions': [
['sysroot!=""', {
'variables': {
'pkg-config': './pkg-config-wrapper "<(sysroot)"',
}, {
},
}, {
'variables': {
'pkg-config': 'pkg-config'
}],
],
},
},
}],
],

'targets': [
{
'target_name': 'gtk',
Expand Down
3 changes: 0 additions & 3 deletions build/temp_gyp/googleurl.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
'variables': {
'chromium_code': 1,
},
'includes': [
'../common.gypi',
],
'targets': [
{
'target_name': 'googleurl',
Expand Down
3 changes: 0 additions & 3 deletions build/temp_gyp/pdfsqueeze.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# found in the LICENSE file.

{
'includes': [
'../common.gypi',
],
'targets': [
{
'target_name': 'pdfsqueeze',
Expand Down
3 changes: 0 additions & 3 deletions build/util/build_util.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# found in the LICENSE file.

{
'includes': [
'../common.gypi',
],
'targets': [
{
'target_name': 'lastchange',
Expand Down
3 changes: 0 additions & 3 deletions build/win/system.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# found in the LICENSE file.

{
'includes': [
'../common.gypi',
],
'targets': [
{
'target_name': 'cygwin',
Expand Down
3 changes: 0 additions & 3 deletions chrome/app/locales/locales.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
# TODO(sgk): eliminate this; see comment in build/common.gypi
'msvs_debug_link_incremental': '1',
},
'includes': [
'../../../build/common.gypi',
],
'target_defaults': {
'type': 'loadable_module',
'dependencies': [
Expand Down
3 changes: 0 additions & 3 deletions chrome/chrome.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@
}],
], # conditions
}, # variables
'includes': [
'../build/common.gypi',
],
'target_defaults': {
'sources/': [
['exclude', '/(cocoa|gtk|win)/'],
Expand Down
3 changes: 0 additions & 3 deletions chrome/installer/installer.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
'lastchange_path': '<(SHARED_INTERMEDIATE_DIR)/build/LASTCHANGE',
# 'branding_dir' is set in the 'conditions' section at the bottom.
},
'includes': [
'../../build/common.gypi',
],
'conditions': [
['OS=="win"', {
'targets': [
Expand Down
3 changes: 0 additions & 3 deletions chrome/installer/mini_installer.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
'msvs_use_common_release': 0,
'msvs_use_common_linker_extras': 0,
},
'includes': [
'../../build/common.gypi',
],
'conditions': [
['OS=="win"', {
'targets': [
Expand Down
3 changes: 0 additions & 3 deletions chrome/test/security_tests/security_tests.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
'variables': {
'chromium_code': 1,
},
'includes': [
'../../../build/common.gypi',
],
'targets': [
{
'target_name': 'security_tests',
Expand Down
3 changes: 0 additions & 3 deletions courgette/courgette.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
'variables': {
'chromium_code': 1,
},
'includes': [
'../build/common.gypi',
],
'targets': [
{
'target_name': 'courgette_lib',
Expand Down
3 changes: 0 additions & 3 deletions gears/gears.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
'variables': {
'chromium_code': 1,
},
'includes': [
'../build/common.gypi',
],
'conditions': [
[ 'OS == "win"', {
'targets': [
Expand Down
3 changes: 0 additions & 3 deletions google_update/google_update.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# found in the LICENSE file.

{
'includes': [
'../build/common.gypi',
],
'targets': [
{
'target_name': 'google_update',
Expand Down
3 changes: 0 additions & 3 deletions ipc/ipc.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# found in the LICENSE file.

{
'includes': [
'../build/common.gypi',
],
'target_defaults': {
'sources/': [
['exclude', '/win/'],
Expand Down
3 changes: 0 additions & 3 deletions media/media.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
'variables': {
'chromium_code': 1,
},
'includes': [
'../build/common.gypi',
],
'target_defaults': {
'conditions': [
['OS!="linux"', {'sources/': [['exclude', '/linux/']]}],
Expand Down
3 changes: 0 additions & 3 deletions net/net.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
'variables': {
'chromium_code': 1,
},
'includes': [
'../build/common.gypi',
],
'targets': [
{
'target_name': 'net',
Expand Down
3 changes: 0 additions & 3 deletions net/tools/tld_cleanup/tld_cleanup.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
'variables': {
'chromium_code': 1,
},
'includes': [
'../../../build/common.gypi',
],
'targets': [
{
'target_name': 'tld_cleanup',
Expand Down
2 changes: 1 addition & 1 deletion o3d/DEPS_gyp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ hooks = [
{
# A change to a .gyp, .gypi, or to GYP itself shound run the generator.
"pattern": "\\.gypi?$|[/\\\\]src[/\\\\]tools[/\\\\]gyp[/\\\\]|MANIFEST$",
"action": ["python", "tools/gyp/gyp", "o3d/build/all.gyp", "--depth", ".",
"action": ["python", "build/gyp_o3d", "build/all.gyp", "--depth", ".",
"-D", "support_macosx_10_4=1"],
},
]
1 change: 0 additions & 1 deletion o3d/build/all.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

{
'includes': [
'../../build/common.gypi',
'common.gypi',
],
'targets': [
Expand Down
3 changes: 0 additions & 3 deletions o3d/build/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# found in the LICENSE file.

{
'includes': [
'../../build/common.gypi',
],
'variables': {
'antlrdir': 'third_party/antlr3',
'breakpaddir': 'breakpad/src',
Expand Down
24 changes: 24 additions & 0 deletions o3d/build/gyp_o3d
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/python

# This script is wrapper for O3D when compiling independently of chromium.
# Like in chromium, the gyp_chromium.gypi include is forced in.

import glob
import os
import shlex
import sys

try:
import gyp
except ImportError, e:
sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '../../tools/gyp/pylib'))
import gyp

if __name__ == '__main__':
args = sys.argv[1:]

# Always include gyp_chromium.gypi
args += ['-I', os.path.join(os.path.dirname(sys.argv[0]),'../../build/gyp_chromium.gypi')]

# Off we go...
sys.exit(gyp.main(args))
3 changes: 0 additions & 3 deletions printing/printing.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
'variables': {
'chromium_code': 1,
},
'includes': [
'../build/common.gypi',
],
'targets': [
{
'target_name': 'printing',
Expand Down
3 changes: 0 additions & 3 deletions rlz/rlz.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# found in the LICENSE file.

{
'includes': [
'../build/common.gypi',
],
'conditions': [
[ 'OS == "win"', {
'targets': [
Expand Down
3 changes: 0 additions & 3 deletions sandbox/sandbox.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
# found in the LICENSE file.

{
'includes': [
'../build/common.gypi',
],
'conditions': [
[ 'OS=="linux" and selinux==0', {
'targets': [
Expand Down
Loading

0 comments on commit 21642ab

Please sign in to comment.