summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-29 22:49:36 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-29 22:49:36 +0000
commitff183afab99ef55906d114db40364a8e4070620f (patch)
treecc75aafe3fb936594bdbddd39a94c0918f3f6a76 /o3d
parentcdb83b9d62064c31a3229a19743866a7d5c20a0b (diff)
downloadchromium_src-ff183afab99ef55906d114db40364a8e4070620f.zip
chromium_src-ff183afab99ef55906d114db40364a8e4070620f.tar.gz
chromium_src-ff183afab99ef55906d114db40364a8e4070620f.tar.bz2
Reorganized dependencies in generated samples_gen.gyp so that the
conversion step always occurs before the copying step, which fixes a build problem on Windows. Worked around a gyp issue on Windows to properly convert both the plugin and WebGL versions of a couple of the assets. BUG=none TEST=built on Windows TBR=gman Review URL: http://codereview.chromium.org/1801008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46002 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r--o3d/samples/samples_gen.py38
1 files changed, 32 insertions, 6 deletions
diff --git a/o3d/samples/samples_gen.py b/o3d/samples/samples_gen.py
index b3c649c..443fd77 100644
--- a/o3d/samples/samples_gen.py
+++ b/o3d/samples/samples_gen.py
@@ -81,7 +81,7 @@ output_file.write("""# Copyright (c) 2009 The Chromium Authors. All rights reser
],
'targets': [
{
- 'target_name': 'build_samples',
+ 'target_name': 'convert_samples',
'type': 'none',
'dependencies': [
'../converter/converter.gyp:o3dConverter',
@@ -108,7 +108,19 @@ def write_action(asset, webgl_mode):
output_file.write(" 'action_name': '%s',\n" % name)
output_file.write(" 'inputs': [\n")
output_file.write(" '<(PRODUCT_DIR)/o3dConverter',\n")
- output_file.write(" '../o3d_assets/samples/%s',\n" % asset['path'])
+ # TODO(kbr): there are a couple of problems with gyp's MSVC
+ # generator which require this workaround right now. First, if two
+ # actions have the same inputs then gyp will arbitrarily hang the
+ # custom build rule off the second input, and the collision will
+ # currently cause one or the other rule to be dropped. Second, if we
+ # just insert a fake second input, without removing the .zip, then
+ # for some reason the .zip ends up in an "_excluded_files" folder in
+ # the project and the non-WebGL version of the asset won't be built.
+ # Here we use a different input for the WebGL version of the assets.
+ if webgl_mode:
+ output_file.write(" '../o3d_assets/samples/%s.fake_webgl_input.txt',\n" % asset['path'])
+ else:
+ output_file.write(" '../o3d_assets/samples/%s',\n" % asset['path'])
output_file.write(" ],\n")
output_file.write(" 'outputs': [\n")
if sys.platform[:5] == 'linux':
@@ -138,11 +150,19 @@ def write_action(asset, webgl_mode):
output_file.write(" },\n")
for asset in assets:
- write_action(asset, False);
+ write_action(asset, False)
if asset.has_key('webgl'):
- write_action(asset, True);
+ write_action(asset, True)
-output_file.write(" ],\n")
+output_file.write(""" ],
+ },
+ {
+ 'target_name': 'copy_samples',
+ 'type': 'none',
+ 'dependencies': [
+ 'convert_samples',
+ ],
+ 'copies': [\n""")
# Coalesce copies by directory so we don't have tons of copies rules
# to parse.
@@ -174,7 +194,6 @@ for item in items:
else:
copies[item_dir] = [item]
-output_file.write(" 'copies': [\n")
for (dir, paths) in copies.items():
output_file.write(" {\n")
output_file.write(" 'destination': " \
@@ -194,6 +213,13 @@ for (dir, paths) in copies.items():
output_file.write(" ],\n")
output_file.write(" },\n")
+output_file.write(""" {
+ 'target_name': 'build_samples',
+ 'type': 'none',
+ 'dependencies': [
+ 'copy_samples',
+ ],
+ },\n""")
output_file.write(" ],\n")
output_file.write("}\n")