OLD | NEW |
| (Empty) |
1 # Copyright 2009, Google Inc. | |
2 # All rights reserved. | |
3 # | |
4 # Redistribution and use in source and binary forms, with or without | |
5 # modification, are permitted provided that the following conditions are | |
6 # met: | |
7 # | |
8 # * Redistributions of source code must retain the above copyright | |
9 # notice, this list of conditions and the following disclaimer. | |
10 # * Redistributions in binary form must reproduce the above | |
11 # copyright notice, this list of conditions and the following disclaimer | |
12 # in the documentation and/or other materials provided with the | |
13 # distribution. | |
14 # * Neither the name of Google Inc. nor the names of its | |
15 # contributors may be used to endorse or promote products derived from | |
16 # this software without specific prior written permission. | |
17 # | |
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 | |
30 | |
31 Import('env') | |
32 env.SConscript('fcollada.scons', exports=['env']) | |
33 | |
34 env.Append( | |
35 CPPPATH=[ | |
36 env.Dir('$CG_DIR/include'), | |
37 env.Dir('$COLLADA_DIR'), | |
38 env.Dir('$COLLADA_DIR/LibXML/include'), | |
39 env.Dir('$ZLIB_DIR'), | |
40 # Include path for generated headers. | |
41 env.Dir('$OBJ_ROOT/compiler/technique'), | |
42 # Include path for Antlr C runtime headers. | |
43 env.Dir('$ANTLRLIBC_DIR/include'), | |
44 ], | |
45 ) | |
46 | |
47 # Add renderer-specific includes to the environment. | |
48 env.Append(CPPPATH = env['RENDERER_INCLUDE_PATH']) | |
49 | |
50 if env.Bit('windows'): | |
51 env.Append( | |
52 CCFLAGS = [ | |
53 '/Ylo3dImport', | |
54 '/FIimport/cross/precompile.h', | |
55 ], | |
56 ) | |
57 pch, pch_obj = env.PCH('cross/precompile.cc') | |
58 env['PCH'] = pch | |
59 env['PCHSTOP'] = 'import/cross/precompile.h' | |
60 else: | |
61 pch_obj = 'cross/precompile.cc' | |
62 env.Append(CCFLAGS = [['-include', 'import/cross/precompile.h']]) | |
63 | |
64 collada_inputs = [ | |
65 'cross/collada.cc', | |
66 'cross/collada_zip_archive.cc', | |
67 'cross/zip_archive.cc', | |
68 'cross/gz_compressor.cc', | |
69 'cross/file_output_stream_processor.cc', | |
70 'cross/tar_generator.cc', | |
71 'cross/targz_generator.cc', | |
72 ] | |
73 | |
74 serialization_objects_inputs = [ | |
75 'cross/camera_info.cc', | |
76 'cross/destination_buffer.cc', | |
77 'cross/json_object.cc', | |
78 ] | |
79 | |
80 archive_inputs = [ | |
81 pch_obj, | |
82 | |
83 'cross/archive_processor.cc', | |
84 'cross/archive_request.cc', | |
85 'cross/gz_decompressor.cc', | |
86 'cross/memory_stream.cc', | |
87 'cross/main_thread_archive_callback_client.cc', | |
88 'cross/raw_data.cc', | |
89 'cross/tar_processor.cc', | |
90 'cross/targz_processor.cc', | |
91 'cross/threaded_stream_processor.cc', | |
92 ] | |
93 | |
94 conditioner_inputs = ['cross/collada_conditioner.cc'] | |
95 | |
96 if env.Bit('mac'): | |
97 conditioner_inputs += [ | |
98 'mac/collada_conditioner_mac.mm', | |
99 ] | |
100 FRAMEWORKS = [ | |
101 'Foundation' | |
102 ] | |
103 | |
104 if env.Bit('windows'): | |
105 conditioner_inputs += [ | |
106 'win/collada_conditioner_win.cc', | |
107 ] | |
108 | |
109 if env.Bit('linux'): | |
110 conditioner_inputs += [ | |
111 'linux/collada_conditioner_linux.cc', | |
112 ] | |
113 | |
114 # Build a library called 'o3dImport' from the input sources. | |
115 env.ComponentLibrary('o3dImport', collada_inputs) | |
116 env.ComponentLibrary('o3dSerializationObjects', serialization_objects_inputs) | |
117 env.ComponentLibrary('o3dArchive', archive_inputs) | |
118 | |
119 # Build a library that ONLY includes the stubbed-out conditioner code | |
120 # TODO: merge this back into o3dImport as soon as the import | |
121 # lib is no longer needed by the plugin. | |
122 env.ComponentLibrary('o3dImportNoConditioner', | |
123 ['cross/collada_conditioner_stub.cc']) | |
124 | |
125 # Build a library that ONLY includes the active conditioner code | |
126 # TODO: merge this back into o3dImport as soon as the import | |
127 # lib is no longer needed by the plugin. | |
128 conditioner_lib = env.ComponentLibrary('o3dImportConditioner', | |
129 conditioner_inputs) | |
130 | |
131 # The conditioner needs these regardless of what renderer we're | |
132 # building for. | |
133 if env.Bit('windows'): | |
134 env.Requires(conditioner_lib, | |
135 env.Replicate('$ARTIFACTS_DIR', | |
136 ['$CG_DIR/bin/cgc.exe', | |
137 '$CG_DIR/bin/cg.dll', | |
138 '$CG_DIR/bin/cgGL.dll', | |
139 '$GLEW_DIR/bin/glew32.dll', | |
140 ])) | |
141 | |
142 if env.Bit('linux'): | |
143 env.Requires(conditioner_lib, | |
144 env.Replicate('$ARTIFACTS_DIR', ['$CG_DIR/bin/cgc', | |
145 '$CG_DIR/lib/libCg.so', | |
146 '$CG_DIR/lib/libCgGL.so', | |
147 '$GLEW_DIR/lib/libGLEW.so.1.5', | |
148 ])) | |
149 | |
150 if env.Bit('mac'): | |
151 env.Requires(conditioner_lib, | |
152 env.Replicate('$ARTIFACTS_DIR', ['$CG_DIR/bin/cgc'])) | |
OLD | NEW |