| 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 'o3dConvert', | |
| 43 'o3dCore', | |
| 44 'o3dArchive', | |
| 45 'o3dImport', | |
| 46 'o3dImportConditioner', | |
| 47 'o3dCorePlatform', | |
| 48 'o3dSerializer', | |
| 49 'o3dSerializationObjects', | |
| 50 'o3dCore', # Archive and Core are mutually dependent so Core appears twice. | |
| 51 'o3dUtils', | |
| 52 'o3d_base', | |
| 53 'FColladaU', | |
| 54 'technique', | |
| 55 'antlr3c', | |
| 56 'google_nacl_imc', | |
| 57 'skia', | |
| 58 ] + env['ICU_LIBS'], | |
| 59 ) | |
| 60 | |
| 61 # add renderer specific libraries and includes to the linker environment | |
| 62 env.Append(CPPPATH = env['RENDERER_INCLUDE_PATH'], | |
| 63 LIBPATH = env['RENDERER_LIB_PATH'], | |
| 64 LIBS = env['RENDERER_LIBS']) | |
| 65 | |
| 66 if env.Bit('windows'): | |
| 67 env.Append( | |
| 68 CCFLAGS=['/Wp64', '/D_CRT_SECURE_NO_WARNINGS'], | |
| 69 LINKFLAGS=['/SUBSYSTEM:CONSOLE'], | |
| 70 LIBS = [ | |
| 71 'cg', | |
| 72 'cgGL', | |
| 73 'd3dx9', | |
| 74 'ole32', | |
| 75 ], | |
| 76 ) | |
| 77 | |
| 78 if env.Bit('mac'): | |
| 79 env.Append( | |
| 80 LINKFLAGS = ['-F$CG_DIR'], | |
| 81 FRAMEWORKS = [ | |
| 82 'ApplicationServices', | |
| 83 'Cg', | |
| 84 'Cocoa', | |
| 85 'Foundation', | |
| 86 'OpenGL', | |
| 87 ], | |
| 88 LIBS = [ | |
| 89 'event', | |
| 90 ], | |
| 91 ) | |
| 92 | |
| 93 if env.Bit('linux'): | |
| 94 env.Append( | |
| 95 LIBS = [ | |
| 96 'event', | |
| 97 ], | |
| 98 ) | |
| 99 | |
| 100 inputs = [ | |
| 101 'cross/converter.cc', | |
| 102 'cross/renderer_stub.cc', | |
| 103 'cross/buffer_stub.cc', | |
| 104 'cross/texture_stub.cc', | |
| 105 ] | |
| 106 | |
| 107 # Create converter library. | |
| 108 lib = env.ComponentLibrary('o3dConvert', inputs) | |
| 109 | |
| 110 # Create a target executable program called 'o3dConverter' | |
| 111 if env.Bit('mac'): | |
| 112 exe = env.ComponentProgram('o3dConverter', | |
| 113 ['mac/converter_main.mm', | |
| 114 'cross/converter_main.cc', | |
| 115 ]) | |
| 116 # Fix executable to look for Cg.framework in the appropriate place. | |
| 117 exe_fix = env.Command('$ARTIFACTS_DIR/converter/fixed_exe.stamp', | |
| 118 [exe], [ | |
| 119 '/usr/bin/install_name_tool' | |
| 120 ' -change ' | |
| 121 '@executable_path/../Library/Frameworks/Cg.framework/Cg ' | |
| 122 '@executable_path/Frameworks/Cg.framework/Cg ' | |
| 123 "$SOURCE", | |
| 124 'touch $TARGET', | |
| 125 ]) | |
| 126 # Copy the resulting executable to the Artifacts directory. | |
| 127 exe_install = env.Replicate('$ARTIFACTS_DIR/converter', [exe]) | |
| 128 env.Depends(exe_install, exe_fix) | |
| 129 else: | |
| 130 exe = env.ComponentProgram('o3dConverter', ['cross/converter_main.cc']) | |
| 131 # Copy the resulting executable to the Artifacts directory. | |
| 132 exe_install = env.Replicate('$ARTIFACTS_DIR', [exe]) | |
| 133 | |
| 134 # Create a target executable program called 'o3dVerifier' | |
| 135 if env.Bit('mac'): | |
| 136 verifier_exe = env.ComponentProgram('o3dVerifier', | |
| 137 ['mac/converter_main.mm', | |
| 138 'cross/verifier_main.cc', | |
| 139 ]) | |
| 140 # Copy the resulting executable to the Artifacts directory. | |
| 141 verifier_exe_install = env.Replicate('$ARTIFACTS_DIR/converter', | |
| 142 [verifier_exe]) | |
| 143 verifier_exe_fix = env.Command('$ARTIFACTS_DIR/converter/verifier_exe.stamp', | |
| 144 [verifier_exe_install], [ | |
| 145 '/usr/bin/install_name_tool' | |
| 146 ' -change ' | |
| 147 '@executable_path/../Library/Frameworks/Cg.framework/Cg ' | |
| 148 '@executable_path/Frameworks/Cg.framework/Cg ' | |
| 149 "$SOURCE", | |
| 150 'touch $TARGET', | |
| 151 ]) | |
| 152 else: | |
| 153 verifier_exe = env.ComponentProgram('o3dVerifier', ['cross/verifier_main.cc']) | |
| 154 # Copy the resulting executable to the Artifacts directory. | |
| 155 verifier_exe_install = env.Replicate('$ARTIFACTS_DIR', [verifier_exe]) | |
| 156 | |
| 157 # Put the Cg DLL's, cgc and the d3dx9 DLL there as well. | |
| 158 if env.Bit('windows'): | |
| 159 env.Requires(exe_install, env.Replicate( | |
| 160 '$ARTIFACTS_DIR', [ | |
| 161 '$CG_DIR/bin/cgc.exe', | |
| 162 '$CG_DIR/bin/cg.dll', | |
| 163 '$CG_DIR/bin/cgGL.dll', | |
| 164 ])) | |
| 165 | |
| 166 if env.Bit('mac'): | |
| 167 env.Requires( | |
| 168 exe_install, | |
| 169 env.Command(env.Dir('$ARTIFACTS_DIR/converter/Frameworks'), | |
| 170 env.Dir("$CG_DIR/Cg.framework"), | |
| 171 [ # Copy in a Cg framework for the converter to use. | |
| 172 'ditto --arch i386 "$CG_DIR/Cg.framework" ' | |
| 173 '"$ARTIFACTS_DIR/converter/Frameworks/Cg.framework"', | |
| 174 ])) | |
| 175 env.Requires(exe_install, env.Replicate( | |
| 176 '$ARTIFACTS_DIR/converter', [ | |
| 177 '$CG_DIR/bin/cgc', | |
| 178 ])) | |
| 179 | |
| 180 if env.Bit('linux'): | |
| 181 env.Requires(exe_install, env.Replicate( | |
| 182 '$ARTIFACTS_DIR', [ | |
| 183 '$CG_DIR/bin/cgc', | |
| 184 '$CG_DIR/lib/libCg.so', | |
| 185 '$CG_DIR/lib/libCgGL.so', | |
| 186 '$GLEW_DIR/lib/libGLEW.so.1.5', | |
| 187 ])) | |
| OLD | NEW |