| 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 | |
| 33 env.Append( | |
| 34 LIBPATH = [ | |
| 35 '$NACL_LIB_DIR', | |
| 36 '$ANTLRLIBC_DIR/lib', | |
| 37 '$OBJ_ROOT/compiler/technique', | |
| 38 '$OBJ_ROOT/compiler/antlr', | |
| 39 '$CG_DIR/lib', | |
| 40 ], | |
| 41 LIBS = [ | |
| 42 'o3dConvertEdge', | |
| 43 'o3dCore', | |
| 44 'o3dArchive', | |
| 45 'o3dImport', | |
| 46 'o3dImportConditioner', | |
| 47 'o3dCorePlatform', | |
| 48 'o3dSerializer', | |
| 49 'o3dSerializationObjects', | |
| 50 'o3dUtils', | |
| 51 'o3d_base', | |
| 52 'FColladaU', | |
| 53 'technique', | |
| 54 'antlr3c', | |
| 55 'google_nacl_imc', | |
| 56 'skia', | |
| 57 ] + env['ICU_LIBS'], | |
| 58 ) | |
| 59 | |
| 60 # add renderer specific libraries and includes to the linker environment | |
| 61 env.Append(CPPPATH = env['RENDERER_INCLUDE_PATH'], | |
| 62 LIBPATH = env['RENDERER_LIB_PATH'], | |
| 63 LIBS = env['RENDERER_LIBS']) | |
| 64 | |
| 65 if env.Bit('windows'): | |
| 66 env.Append( | |
| 67 CCFLAGS=['/Wp64', '/D_CRT_SECURE_NO_WARNINGS'], | |
| 68 LINKFLAGS=['/SUBSYSTEM:CONSOLE'], | |
| 69 LIBS = [ | |
| 70 'cg', | |
| 71 'cgGL', | |
| 72 'd3dx9', | |
| 73 'ole32', | |
| 74 ], | |
| 75 ) | |
| 76 | |
| 77 if env.Bit('mac'): | |
| 78 env.Append( | |
| 79 LINKFLAGS = ['-F$CG_DIR'], | |
| 80 FRAMEWORKS = [ | |
| 81 'ApplicationServices', | |
| 82 'Cg', | |
| 83 'Foundation', | |
| 84 'OpenGL', | |
| 85 ], | |
| 86 ) | |
| 87 | |
| 88 inputs = [ | |
| 89 'cross/converter.cc', | |
| 90 'cross/renderer_stub.cc', | |
| 91 'cross/buffer_stub.cc', | |
| 92 'cross/texture_stub.cc', | |
| 93 ] | |
| 94 | |
| 95 # Create converter library. | |
| 96 lib = env.ComponentLibrary('o3dConvertEdge', inputs) | |
| 97 | |
| 98 # Create a target executable program called 'o3dConverterEdge' | |
| 99 if env.Bit('mac'): | |
| 100 exe = env.ComponentProgram('o3dConverterEdge', | |
| 101 ['mac/converter_main.mm', | |
| 102 'cross/converter_main.cc', | |
| 103 ]) | |
| 104 # Fix executable to look for Cg.framework in the appropriate place. | |
| 105 exe_fix = env.Command('$ARTIFACTS_DIR/converter/fixed_exe.stamp', | |
| 106 [exe], [ | |
| 107 '/usr/bin/install_name_tool' | |
| 108 ' -change ' | |
| 109 '@executable_path/../Library/Frameworks/Cg.framework/Cg ' | |
| 110 '@executable_path/Frameworks/Cg.framework/Cg ' | |
| 111 "$SOURCE", | |
| 112 'touch $TARGET', | |
| 113 ]) | |
| 114 # Copy the resulting executable to the Artifacts directory. | |
| 115 exe_install = env.Replicate('$ARTIFACTS_DIR/converter', [exe]) | |
| 116 env.Depends(exe_install, exe_fix) | |
| 117 else: | |
| 118 exe = env.ComponentProgram('o3dConverterEdge', ['cross/converter_main.cc']) | |
| 119 # Copy the resulting executable to the Artifacts directory. | |
| 120 exe_install = env.Replicate('$ARTIFACTS_DIR', [exe]) | |
| 121 | |
| 122 # Put the Cg DLL's, cgc and the d3dx9 DLL there as well. | |
| 123 if env.Bit('windows'): | |
| 124 env.Requires(exe_install, env.Replicate( | |
| 125 '$ARTIFACTS_DIR', [ | |
| 126 '$CG_DIR/bin/cgc.exe', | |
| 127 '$CG_DIR/bin/cg.dll', | |
| 128 '$CG_DIR/bin/cgGL.dll', | |
| 129 ])) | |
| 130 | |
| 131 if env.Bit('mac'): | |
| 132 env.Requires( | |
| 133 exe_install, | |
| 134 env.Command(env.Dir('$ARTIFACTS_DIR/converter/Frameworks'), | |
| 135 env.Dir("$CG_DIR/Cg.framework"), | |
| 136 [ # Copy in a Cg framework for the converter to use. | |
| 137 'ditto --arch i386 "$CG_DIR/Cg.framework" ' | |
| 138 '"$ARTIFACTS_DIR/converter/Frameworks/Cg.framework"', | |
| 139 ])) | |
| 140 env.Requires(exe_install, env.Replicate( | |
| 141 '$ARTIFACTS_DIR/converter', [ | |
| 142 '$CG_DIR/bin/cgc', | |
| 143 ])) | |
| 144 | |
| 145 if env.Bit('linux'): | |
| 146 env.Requires(exe_install, env.Replicate( | |
| 147 '$ARTIFACTS_DIR', [ | |
| 148 '$CG_DIR/bin/cgc', | |
| 149 '$CG_DIR/lib/libCg.so', | |
| 150 '$CG_DIR/lib/libCgGL.so', | |
| 151 '$GLEW_DIR/lib/libGLEW.so.1.5', | |
| 152 ])) | |
| OLD | NEW |