| 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 the build environment that was decided in the project SConstruct. | |
| 32 # This may be the Debug or Optimized environment | |
| 33 Import('env') | |
| 34 | |
| 35 # Cross platform inputs used to build the cross platform library. | |
| 36 cross_inputs = [ | |
| 37 'cross/bounding_box.cc', | |
| 38 'cross/buffer.cc', | |
| 39 'cross/canvas.cc', | |
| 40 'cross/canvas_paint.cc', | |
| 41 'cross/canvas_shader.cc', | |
| 42 'cross/class_manager.cc', | |
| 43 'cross/clear_buffer.cc', | |
| 44 'cross/client.cc', | |
| 45 'cross/client_info.cc', | |
| 46 'cross/core_metrics.cc', | |
| 47 'cross/counter.cc', | |
| 48 'cross/counter_manager.cc', | |
| 49 'cross/curve.cc', | |
| 50 'cross/draw_context.cc', | |
| 51 'cross/draw_element.cc', | |
| 52 'cross/draw_list.cc', | |
| 53 'cross/draw_list_manager.cc', | |
| 54 'cross/draw_pass.cc', | |
| 55 'cross/effect.cc', | |
| 56 'cross/element.cc', | |
| 57 'cross/error_status.cc', | |
| 58 'cross/error_stream_manager.cc', | |
| 59 'cross/evaluation_counter.cc', | |
| 60 'cross/event.cc', | |
| 61 'cross/event_manager.cc', | |
| 62 'cross/features.cc', | |
| 63 'cross/field.cc', | |
| 64 'cross/file_request.cc', | |
| 65 'cross/function.cc', | |
| 66 'cross/iclass_manager.cc', | |
| 67 'cross/ierror_status.cc', | |
| 68 'cross/id_manager.cc', | |
| 69 'cross/image_utils.cc', | |
| 70 'cross/imain_thread_task_poster.cc', | |
| 71 'cross/material.cc', | |
| 72 'cross/math_utilities.cc', | |
| 73 'cross/matrix4_axis_rotation.cc', | |
| 74 'cross/matrix4_composition.cc', | |
| 75 'cross/matrix4_scale.cc', | |
| 76 'cross/matrix4_translation.cc', | |
| 77 'cross/message_commands.cc', | |
| 78 'cross/message_queue.cc', | |
| 79 'cross/named_object.cc', | |
| 80 'cross/object_base.cc', | |
| 81 'cross/object_manager.cc', | |
| 82 'cross/pack.cc', | |
| 83 'cross/param.cc', | |
| 84 'cross/param_array.cc', | |
| 85 'cross/param_cache.cc', | |
| 86 'cross/param_object.cc', | |
| 87 'cross/param_operation.cc', | |
| 88 'cross/primitive.cc', | |
| 89 'cross/profiler.cc', | |
| 90 'cross/ray_intersection_info.cc', | |
| 91 'cross/renderer.cc', | |
| 92 'cross/render_context.cc', | |
| 93 'cross/render_node.cc', | |
| 94 'cross/render_surface.cc', | |
| 95 'cross/render_surface_set.cc', | |
| 96 'cross/sampler.cc', | |
| 97 'cross/semantic_manager.cc', | |
| 98 'cross/service_locator.cc', | |
| 99 'cross/shape.cc', | |
| 100 'cross/skin.cc', | |
| 101 'cross/state.cc', | |
| 102 'cross/state_set.cc', | |
| 103 'cross/standard_param.cc', | |
| 104 'cross/stream.cc', | |
| 105 'cross/stream_bank.cc', | |
| 106 'cross/texture.cc', | |
| 107 'cross/texture_base.cc', | |
| 108 'cross/timer.cc', | |
| 109 'cross/tree_traversal.cc', | |
| 110 'cross/transform.cc', | |
| 111 'cross/transformation_context.cc', | |
| 112 'cross/vertex_source.cc', | |
| 113 'cross/viewport.cc', | |
| 114 # These will eventually move, but they are cross platform now | |
| 115 'cross/bitmap.cc', | |
| 116 'cross/bitmap_tga.cc', | |
| 117 'cross/bitmap_png.cc', | |
| 118 'cross/bitmap_jpg.cc', | |
| 119 # 'cross/bitmap_gif.cc', | |
| 120 'cross/bitmap_dds.cc', | |
| 121 ] | |
| 122 | |
| 123 env.Append(CPPPATH=['$SKIA_DIR/include/core', | |
| 124 '$SKIA_DIR/include/effects'], | |
| 125 CPPDEFINES = [('O3D_PLUGIN_VERSION', '\\"$O3D_PLUGIN_VERSION\\"')]) | |
| 126 | |
| 127 # Renderer and platform specific inputs. | |
| 128 platform_inputs = [] | |
| 129 | |
| 130 | |
| 131 # Add a precompiled header declaration to the Windows environment. | |
| 132 if env['TARGET_PLATFORM'] == 'WINDOWS': | |
| 133 env.Append( | |
| 134 CCFLAGS = [ | |
| 135 '/Ylcore', | |
| 136 '/FIcore/cross/precompile.h' | |
| 137 ], | |
| 138 ) | |
| 139 pch, pch_obj = env.PCH('cross/precompile.cc') | |
| 140 env['PCH'] = pch | |
| 141 env['PCHSTOP'] = 'core/cross/precompile.h' | |
| 142 platform_inputs += [pch_obj] | |
| 143 else: | |
| 144 platform_inputs += ['cross/precompile.cc'] | |
| 145 env.Append(CCFLAGS = [['-include', 'core/cross/precompile.h']]) | |
| 146 | |
| 147 # Based on the renderer requested, append the platform-specific source | |
| 148 if 'RENDERER_D3D9' in env['CPPDEFINES'] : | |
| 149 platform_inputs += [ | |
| 150 'win/d3d9/buffer_d3d9.cc', | |
| 151 'win/d3d9/draw_element_d3d9.cc', | |
| 152 'win/d3d9/effect_d3d9.cc', | |
| 153 'win/d3d9/install_check.cc', | |
| 154 'win/d3d9/param_cache_d3d9.cc', | |
| 155 'win/d3d9/sampler_d3d9.cc', | |
| 156 'win/d3d9/stream_bank_d3d9.cc', | |
| 157 'win/d3d9/primitive_d3d9.cc', | |
| 158 'win/d3d9/renderer_d3d9.cc', | |
| 159 'win/d3d9/render_surface_d3d9.cc', | |
| 160 'win/d3d9/texture_d3d9.cc', | |
| 161 'win/d3d9/utils_d3d9.cc', | |
| 162 ] | |
| 163 elif 'RENDERER_GL' in env['CPPDEFINES'] : | |
| 164 platform_inputs += [ | |
| 165 'cross/gl/buffer_gl.cc', | |
| 166 'cross/gl/draw_element_gl.cc', | |
| 167 'cross/gl/effect_gl.cc', | |
| 168 'cross/gl/install_check.cc', | |
| 169 'cross/gl/param_cache_gl.cc', | |
| 170 'cross/gl/primitive_gl.cc', | |
| 171 'cross/gl/renderer_gl.cc', | |
| 172 'cross/gl/stream_bank_gl.cc', | |
| 173 'cross/gl/render_surface_gl.cc', | |
| 174 'cross/gl/texture_gl.cc', | |
| 175 'cross/gl/utils_gl.cc', | |
| 176 "cross/gl/sampler_gl.cc", | |
| 177 ] | |
| 178 elif 'RENDERER_MOCK' in env['CPPDEFINES'] : | |
| 179 platform_inputs += [ ] | |
| 180 else : | |
| 181 print 'No renderer defined, exiting.\n' | |
| 182 print """Add 'RENDERER=gl' or 'RENDERER=d3d' to the command line.""" | |
| 183 Exit(1) | |
| 184 | |
| 185 if env['TARGET_PLATFORM'] == 'MAC': | |
| 186 platform_inputs += [ | |
| 187 "mac/performance_timer.cc", | |
| 188 ] | |
| 189 | |
| 190 if env['TARGET_PLATFORM'] == 'WINDOWS': | |
| 191 platform_inputs += [ | |
| 192 "win/performance_timer.cc", | |
| 193 ] | |
| 194 | |
| 195 if env['TARGET_PLATFORM'] == 'LINUX': | |
| 196 platform_inputs += [ | |
| 197 "linux/performance_timer.cc", | |
| 198 ] | |
| 199 | |
| 200 env.Append(CPPPATH = env['RENDERER_INCLUDE_PATH']) | |
| 201 | |
| 202 # Create a platform independent library from the cross sources | |
| 203 # called "o3dCore" | |
| 204 o3dcore_lib = env.ComponentLibrary('o3dCore', cross_inputs) | |
| 205 | |
| 206 | |
| 207 # Create a platform-specific target library from the sources | |
| 208 # called "o3dCorePlatform" | |
| 209 o3dcorerender_lib = env.ComponentLibrary('o3dCorePlatform', platform_inputs) | |
| OLD | NEW |