Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Upgrade GYP to r1107
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Dec 16, 2011
1 parent 1865b11 commit 64de69c
Show file tree
Hide file tree
Showing 16 changed files with 1,214 additions and 1,104 deletions.
3 changes: 3 additions & 0 deletions tools/gyp/pylib/gyp/common.py
Expand Up @@ -76,6 +76,9 @@ def ResolveTarget(build_file, target, toolset):
# and os.path.join will return it as-is.
build_file = os.path.normpath(os.path.join(os.path.dirname(build_file),
parsed_build_file))
# Further (to handle cases like ../cwd), make it relative to cwd)
if not os.path.isabs(build_file):
build_file = RelativePath(build_file, '.')
else:
build_file = parsed_build_file

Expand Down
38 changes: 21 additions & 17 deletions tools/gyp/pylib/gyp/generator/make.py
Expand Up @@ -2015,6 +2015,27 @@ def WriteTarget(self, spec, configs, deps, link_deps, bundle_deps,
order_only = True,
multiple_output_trick = False)

if self.flavor == 'mac':
# Write an envvar for postbuilds.
# CHROMIUM_STRIP_SAVE_FILE is a chromium-specific hack.
# TODO(thakis): It would be nice to have some general mechanism instead.
# This variable may be referenced by TARGET_POSTBUILDS_$(BUILDTYPE),
# so we must output its definition first, since we declare variables
# using ":=".
# TODO(thakis): Write this only for targets that actually have
# postbuilds.
strip_save_file = self.xcode_settings.GetPerTargetSetting(
'CHROMIUM_STRIP_SAVE_FILE')
if strip_save_file:
strip_save_file = self.Absolutify(strip_save_file)
else:
# Explicitly clear this out, else a postbuild might pick up an export
# from an earlier target.
strip_save_file = ''
self.WriteXcodeEnv(
self.output, spec,
additional_settings={'CHROMIUM_STRIP_SAVE_FILE': strip_save_file})

has_target_postbuilds = False
if self.type != 'none':
for configname in sorted(configs.keys()):
Expand Down Expand Up @@ -2078,23 +2099,6 @@ def WriteTarget(self, spec, configs, deps, link_deps, bundle_deps,
postbuilds.append(gyp.common.EncodePOSIXShellList(shell_list))

if postbuilds:
# Write envvars for postbuilds.
extra_settings = {}

# CHROMIUM_STRIP_SAVE_FILE is a chromium-specific hack.
# TODO(thakis): It would be nice to have some general mechanism instead.
strip_save_file = self.xcode_settings.GetPerTargetSetting(
'CHROMIUM_STRIP_SAVE_FILE')
if strip_save_file:
strip_save_file = self.Absolutify(strip_save_file)
else:
# Explicitly clear this out, else a postbuild might pick up an export
# from an earlier target.
strip_save_file = ''
extra_settings['CHROMIUM_STRIP_SAVE_FILE'] = strip_save_file

self.WriteXcodeEnv(self.output, spec, additional_settings=extra_settings)

for i in xrange(len(postbuilds)):
if not postbuilds[i].startswith('$'):
postbuilds[i] = EscapeShellArgument(postbuilds[i])
Expand Down
1 change: 1 addition & 0 deletions tools/gyp/test/mac/gyptest-strip.py
Expand Up @@ -49,5 +49,6 @@ def CheckNsyms(p, n_expected):
CheckNsyms(test.built_file_path(
'strip_all_bundle.framework/Versions/A/strip_all_bundle', chdir='strip'),
0)
CheckNsyms(OutPath('strip_save'), 3)

test.pass_test()
5 changes: 5 additions & 0 deletions tools/gyp/test/mac/strip/strip.saves
@@ -0,0 +1,5 @@
# Copyright (c) 2011 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.

# This file would list symbols that should not be stripped.
11 changes: 11 additions & 0 deletions tools/gyp/test/mac/strip/test.gyp
Expand Up @@ -100,5 +100,16 @@
'STRIP_STYLE': 'all',
},
},
{
'target_name': 'strip_save',
'type': 'shared_library',
'sources': [ 'file.c', ],
'xcode_settings': {
'DEPLOYMENT_POSTPROCESSING': 'YES',
'STRIP_INSTALLED_PRODUCT': 'YES',
'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
'CHROMIUM_STRIP_SAVE_FILE': 'strip.saves',
},
},
],
}
9 changes: 9 additions & 0 deletions tools/gyp/test/relative/foo/a/a.cc
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2011 Google Inc. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/

int main() {
return 0;
}
13 changes: 13 additions & 0 deletions tools/gyp/test/relative/foo/a/a.gyp
@@ -0,0 +1,13 @@
{
'targets': [
{
'target_name': 'a',
'type': 'executable',
'sources': ['a.cc'],
'dependencies': [
'../../foo/b/b.gyp:b',
'c/c.gyp:c',
],
},
],
}
9 changes: 9 additions & 0 deletions tools/gyp/test/relative/foo/a/c/c.cc
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2011 Google Inc. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/

int func() {
return 0;
}
12 changes: 12 additions & 0 deletions tools/gyp/test/relative/foo/a/c/c.gyp
@@ -0,0 +1,12 @@
{
'targets': [
{
'target_name': 'c',
'type': 'static_library',
'sources': ['c.cc'],
'dependencies': [
'../../b/b.gyp:b',
],
},
],
}
9 changes: 9 additions & 0 deletions tools/gyp/test/relative/foo/b/b.cc
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2011 Google Inc. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/

int func2() {
return 0;
}
9 changes: 9 additions & 0 deletions tools/gyp/test/relative/foo/b/b.gyp
@@ -0,0 +1,9 @@
{
'targets': [
{
'target_name': 'b',
'type': 'static_library',
'sources': ['b.cc'],
},
],
}
25 changes: 25 additions & 0 deletions tools/gyp/test/relative/gyptest-default.py
@@ -0,0 +1,25 @@
#!/usr/bin/env python

# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""
Verifies simplest-possible build of a "Hello, world!" program
using the default build target.
"""

import TestGyp

test = TestGyp.TestGyp(workdir='workarea_default', formats=['msvs'])

# Run from down in foo.
test.run_gyp('a.gyp', chdir='foo/a')
sln = test.workpath('foo/a/a.sln')
sln_data = open(sln, 'rb').read()
vcproj = sln_data.count('b.vcproj')
vcxproj = sln_data.count('b.vcxproj')
if (vcproj, vcxproj) not in [(1, 0), (0, 1)]:
test.fail_test()

test.pass_test()

0 comments on commit 64de69c

Please sign in to comment.