diff options
author | gspencer@google.com <gspencer@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-30 23:52:04 +0000 |
---|---|---|
committer | gspencer@google.com <gspencer@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-30 23:52:04 +0000 |
commit | b868366d9fa4b4372db9bef4eb051cba14d25894 (patch) | |
tree | e2a4ea743bd4fe45a5ada203a040eb88bd9edfa8 /o3d | |
parent | 92f6b46fbf2bf91fb59a4a74981eb3d6b3a27e97 (diff) | |
download | chromium_src-b868366d9fa4b4372db9bef4eb051cba14d25894.zip chromium_src-b868366d9fa4b4372db9bef4eb051cba14d25894.tar.gz chromium_src-b868366d9fa4b4372db9bef4eb051cba14d25894.tar.bz2 |
This adds the sample conversion to the GYP build, at least on Windows.
It also fixes some small problems with the build (naming of plugin DLL and
activex host dll)
Review URL: http://codereview.chromium.org/160428
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22122 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r-- | o3d/DEPS_gyp | 13 | ||||
-rw-r--r-- | o3d/build/all.gyp | 5 | ||||
-rw-r--r-- | o3d/build/libs.gyp | 36 | ||||
-rw-r--r-- | o3d/build/nacl.gyp | 2 | ||||
-rw-r--r-- | o3d/converter/converter.gyp | 1 | ||||
-rw-r--r-- | o3d/core/cross/message_queue.cc | 1 | ||||
-rw-r--r-- | o3d/import/import.gyp | 9 | ||||
-rw-r--r-- | o3d/plugin/plugin.gyp | 4 | ||||
-rw-r--r-- | o3d/samples/samples.gyp | 21 | ||||
-rw-r--r-- | o3d/samples/samples_gen.py | 152 | ||||
-rw-r--r-- | o3d/serializer/serializer.gyp | 3 |
11 files changed, 235 insertions, 12 deletions
diff --git a/o3d/DEPS_gyp b/o3d/DEPS_gyp index c395d5e..8e823a9 100644 --- a/o3d/DEPS_gyp +++ b/o3d/DEPS_gyp @@ -1,16 +1,15 @@ vars = { - "chromium_trunk": - "http://src.chromium.org/svn/trunk", + "chromium_trunk": "http://src.chromium.org/svn/trunk", "nixysa_rev": "28", "chromium_rev": "21287", "o3d_code_rev": "109", "skia_rev": "279", - "gyp_rev": "553", + "gyp_rev": "563", "gtest_rev": "267", "gflags_rev": "30", "breakpad_rev": "346", - "icu38_rev": "20192", "v8_rev": "2507", + "icu38_rev": "20192", } deps = { @@ -38,9 +37,6 @@ deps = { "third_party/scons": "http://o3d.googlecode.com/svn/trunk/googleclient/third_party/scons@" + Var("o3d_code_rev"), - "third_party/selenium_rc": - "http://o3d.googlecode.com/svn/trunk/googleclient/third_party/selenium_rc@" + Var("o3d_code_rev"), - "third_party/vectormath": "http://o3d.googlecode.com/svn/trunk/googleclient/third_party/vectormath@" + Var("o3d_code_rev"), @@ -50,6 +46,9 @@ deps = { "third_party/zip_utils": "http://o3d.googlecode.com/svn/trunk/googleclient/third_party/zip_utils@" + Var("o3d_code_rev"), + "third_party/selenium_rc": + "http://o3d.googlecode.com/svn/trunk/googleclient/third_party/selenium_rc@" + Var("o3d_code_rev"), + # Stuff from the Chromium tree. "third_party/skia": diff --git a/o3d/build/all.gyp b/o3d/build/all.gyp index 2229b2e3..bda0373 100644 --- a/o3d/build/all.gyp +++ b/o3d/build/all.gyp @@ -25,9 +25,10 @@ '../import/import.gyp:o3dImport', '../plugin/idl/idl.gyp:o3dPluginIdl', '../plugin/plugin.gyp:add_version', - '../plugin/plugin.gyp:o3dPlugin', + '../plugin/plugin.gyp:npo3dautoplugin', '../plugin/plugin.gyp:o3dPluginLogging', '../serializer/serializer.gyp:o3dSerializer', + '../samples/samples.gyp:*', '../statsreport/statsreport.gyp:o3dStatsReport', '../tests/tests.gyp:unit_tests', '../utils/utils.gyp:o3dUtils', @@ -36,7 +37,7 @@ ['OS=="win"', { 'dependencies': [ - '../plugin/plugin.gyp:o3dActiveXHost', + '../plugin/plugin.gyp:o3d_host', ], }, ], diff --git a/o3d/build/libs.gyp b/o3d/build/libs.gyp new file mode 100644 index 0000000..64e597a --- /dev/null +++ b/o3d/build/libs.gyp @@ -0,0 +1,36 @@ +# Copyright (c) 2009 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. + +{ + 'variables': { + 'chromium_code': 1, + }, + 'includes': [ + 'common.gypi', + ], + 'targets': [ + { + 'target_name': 'cg_libs', + 'type': 'none', + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)', + 'conditions' : [ + [ 'OS=="win"', + { + 'files': [ + "../../<(cgdir)/bin/cg.dll", + "../../<(cgdir)/bin/cgD3D9.dll", + "../../<(cgdir)/bin/cgGL.dll", + "../../<(cgdir)/bin/cgc.exe", + "../../<(cgdir)/bin/glut32.dll", + ], + }, + ], + ], + }, + ], + }, + ], +} diff --git a/o3d/build/nacl.gyp b/o3d/build/nacl.gyp index 29304ba..19b4de5 100644 --- a/o3d/build/nacl.gyp +++ b/o3d/build/nacl.gyp @@ -40,7 +40,7 @@ ], 'direct_dependent_settings': { 'include_dirs': [ - '<(nacldir)', + '../../<(nacldir)', ], 'libraries': [ '<(nacl_output_dir)/google_nacl_imc<(LIBRARY_SUFFIX)', diff --git a/o3d/converter/converter.gyp b/o3d/converter/converter.gyp index a671f29..dfd85b0 100644 --- a/o3d/converter/converter.gyp +++ b/o3d/converter/converter.gyp @@ -35,6 +35,7 @@ '../import/import.gyp:o3dImport', '../serializer/serializer.gyp:o3dSerializer', '../utils/utils.gyp:o3dUtils', + '../build/libs.gyp:cg_libs', ], 'sources': [ 'cross/buffer_stub.cc', diff --git a/o3d/core/cross/message_queue.cc b/o3d/core/cross/message_queue.cc index eb4cc04..bb5f8da 100644 --- a/o3d/core/cross/message_queue.cc +++ b/o3d/core/cross/message_queue.cc @@ -715,6 +715,7 @@ bool MessageQueue::ProcessUnregisterSharedMemory(ConnectedClient* client, bool res = client->UnregisterSharedMemory(buffer_id); SendBooleanResponse(client->client_handle(), res); + return true; } diff --git a/o3d/import/import.gyp b/o3d/import/import.gyp index 6b716b2..9943b00 100644 --- a/o3d/import/import.gyp +++ b/o3d/import/import.gyp @@ -86,6 +86,15 @@ ], }, { + 'target_name': 'o3dSerializationObjects', + 'type': 'static_library', + 'sources': [ + 'cross/camera_info.cc', + 'cross/destination_buffer.cc', + 'cross/json_object.cc', + ], + }, + { 'target_name': 'o3dImportTest', 'type': 'none', 'direct_dependent_settings': { diff --git a/o3d/plugin/plugin.gyp b/o3d/plugin/plugin.gyp index 8891709..22a881e 100644 --- a/o3d/plugin/plugin.gyp +++ b/o3d/plugin/plugin.gyp @@ -24,7 +24,7 @@ }, 'targets': [ { - 'target_name': 'o3dPlugin', + 'target_name': 'npo3dautoplugin', 'type': '<(o3d_main_lib_type)', 'dependencies': [ '../../<(jpegdir)/libjpeg.gyp:libjpeg', @@ -217,7 +217,7 @@ { 'targets': [ { - 'target_name': 'o3dActiveXHost', + 'target_name': 'o3d_host', 'type': 'shared_library', 'include_dirs': [ '<(INTERMEDIATE_DIR)', diff --git a/o3d/samples/samples.gyp b/o3d/samples/samples.gyp new file mode 100644 index 0000000..5c5a195 --- /dev/null +++ b/o3d/samples/samples.gyp @@ -0,0 +1,21 @@ +# Copyright (c) 2009 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. + +{ + 'variables': { + 'chromium_code': 1, + }, + 'includes': [ + '../build/common.gypi', + ], + 'targets': [ + { + 'target_name': 'samples', + 'type': 'none', + 'dependencies': [ + '<!(python samples_gen.py):build_samples', + ], + }, + ], +} diff --git a/o3d/samples/samples_gen.py b/o3d/samples/samples_gen.py new file mode 100644 index 0000000..783565c --- /dev/null +++ b/o3d/samples/samples_gen.py @@ -0,0 +1,152 @@ +#!/usr/bin/env python
+
+import os.path
+import sys
+
+output_filename = 'samples_gen.gyp'
+try:
+ output_file = open(output_filename, "w+")
+except IOError:
+ sys.stderr.write('Unable to write to generated gyp file %s\n',
+ output_filename)
+
+x_up = '1,0,0'
+y_up = '0,1,0'
+z_up = '0,0,1'
+
+names = {
+ x_up : 'x_up',
+ y_up : 'y_up',
+ z_up : 'z_up',
+}
+
+assets = [
+ {'path': 'beachdemo/convert_assets/beachdemo.zip', 'up': z_up},
+ {'path': 'beachdemo/convert_assets/beach-low-poly.dae', 'up': z_up},
+ {'path': 'GoogleIO-2009/convert_assets/background.zip', 'up': y_up},
+ {'path': 'GoogleIO-2009/convert_assets/character.zip', 'up': y_up},
+ {'path': 'home-configurators/convert_cbassets/House_Roofless.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Agra_Rug.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Asimi_Rug.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Camden_Chair.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Elements_Bookshelf.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Ferrara_Rug.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Lounge_Chair.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Lounge_Chaise.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Lounge_Sofa.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Lounge_Storage_Ottoman.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Madison_Dining_Table.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Miles_Side_Chair.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Pullman_Bar_Stool.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Puzzle_TV_Stand.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Stow_Leather_Ottoman.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Tivoli_Dining_Table.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Tivoli_Miles_Dining_Set.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Troy_Chair.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Troy_Ottoman.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Troy_Sofa.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Troy_Storage_Ottoman.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Troy_Twin_Sleeper.kmz', 'up': z_up},
+
+ {'path': 'io/convert_levels/all_actors.kmz', 'up': y_up},
+ {'path': 'io/convert_levels/map1.kmz', 'up': y_up},
+ {'path': 'simpleviewer/convert_assets/cube.zip', 'up': y_up},
+ {'path': 'convert_assets/dome1.zip', 'up': y_up},
+ {'path': 'convert_assets/dome2.zip', 'up': y_up},
+ {'path': 'convert_assets/dome3.zip', 'up': y_up},
+ {'path': 'convert_assets/dome4.zip', 'up': y_up},
+ {'path': 'convert_assets/kitty_151_idle_stand05_cff1.zip', 'up': y_up},
+ {'path': 'convert_assets/part1.zip', 'up': y_up},
+ {'path': 'convert_assets/part2.zip', 'up': y_up},
+ {'path': 'convert_assets/part3.zip', 'up': y_up},
+ {'path': 'convert_assets/seven_shapes.zip', 'up': y_up},
+ {'path': 'convert_assets/stencil_frame.zip', 'up': y_up},
+ {'path': 'convert_assets/teapot.zip', 'up': y_up},
+ {'path': 'convert_assets/yard.zip', 'up': y_up},
+ {'path': 'waterdemo/convert_assets/bamboo.zip', 'up': y_up},
+ {'path': 'waterdemo/convert_assets/coconuts.zip', 'up': y_up},
+ {'path': 'waterdemo/convert_assets/driftwood.zip', 'up': y_up},
+ {'path': 'waterdemo/convert_assets/island.zip', 'up': y_up},
+ {'path': 'waterdemo/convert_assets/lazy_bridge.zip', 'up': y_up},
+ {'path': 'waterdemo/convert_assets/palm_leaves.zip', 'up': y_up},
+ {'path': 'waterdemo/convert_assets/palm_trees.zip', 'up': y_up},
+ {'path': 'waterdemo/convert_assets/rocks.9.zip', 'up': y_up},
+ {'path': 'waterdemo/convert_assets/rocks.zip', 'up': y_up},
+]
+
+output_file.write("""# Copyright (c) 2009 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.
+
+{
+ 'variables': {
+ 'chromium_code': 1,
+ },
+ 'includes': [
+ '../build/common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'build_samples',
+ 'type': 'none',
+ 'dependencies': [
+ '../converter/converter.gyp:o3dConverter',
+ ],
+ 'actions': [\n""")
+for asset in assets:
+ filename = os.path.splitext(os.path.basename(asset['path']))[0]
+ filename = filename.replace('.','_')
+ filename = filename.replace('-','_')
+ filename = filename.lower()
+ name = "convert_" + filename
+ output = asset['path'].replace('convert_', '')
+ output = os.path.splitext(output)[0] + ".o3dtgz"
+ output_dir = os.path.dirname(output)
+ output_file.write(" {\n")
+ output_file.write(" 'action_name': '%s',\n" % name)
+ output_file.write(" 'inputs': [\n")
+ output_file.write(" '../o3d_assets/samples/%s',\n" % asset['path'])
+ output_file.write(" ],\n")
+ output_file.write(" 'outputs': [\n")
+ output_file.write(" '../samples/%s',\n" % output)
+ output_file.write(" ],\n")
+ output_file.write(" 'action': [\n")
+ output_file.write(" '<(PRODUCT_DIR)/o3dConverter',\n")
+ output_file.write(" '--no-condition',\n")
+ output_file.write(" '--up-axis=%s',\n" % asset['up'])
+ output_file.write(" '<(_inputs)',\n")
+ output_file.write(" '<(_outputs)',\n")
+ output_file.write(" ],\n")
+ output_file.write(" },\n")
+
+output_file.write(" ],\n")
+
+# coalesce copies.
+copies = {}
+for asset in assets:
+ output = asset['path'].replace('convert_', '')
+ output = os.path.splitext(output)[0] + ".o3dtgz"
+ output_dir = os.path.dirname(output)
+ if output_dir in copies:
+ copies[output_dir] += [output]
+ else:
+ copies[output_dir] = [output]
+
+output_file.write(" 'copies': [\n")
+for (dir, paths) in copies.items():
+ output_file.write(" {\n")
+ output_file.write(" 'destination': " \
+ "'<(PRODUCT_DIR)/samples/%s',\n" % dir)
+ output_file.write(" 'files': [\n")
+ for path in paths:
+ output_file.write(" '../samples/%s',\n" % path)
+ output_file.write(" ],\n")
+ output_file.write(" },\n")
+
+output_file.write(" ],\n")
+output_file.write(" },\n")
+output_file.write(" ],\n")
+output_file.write("}\n")
+
+print output_filename
+sys.exit(0)
diff --git a/o3d/serializer/serializer.gyp b/o3d/serializer/serializer.gyp index 9953aaf..69c6e1d 100644 --- a/o3d/serializer/serializer.gyp +++ b/o3d/serializer/serializer.gyp @@ -20,6 +20,9 @@ { 'target_name': 'o3dSerializer', 'type': 'static_library', + 'dependencies': [ + '../import/import.gyp:o3dSerializationObjects', + ], 'sources': [ 'cross/serializer.cc', 'cross/serializer.h', |