| 1 | import os, sys, platform |
|---|
| 2 | |
|---|
| 3 | Import('env') |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | env.StaticLibrary( |
|---|
| 7 | target="cfsLib", |
|---|
| 8 | source=Split("""Bitmap/Bitmap.cpp Bitmap/jdatasrc.cpp |
|---|
| 9 | ConsoleCommands/ConVar.cpp ConsoleCommands/ConFunc.cpp |
|---|
| 10 | ConsoleCommands/ConsoleInterpreterImpl.cpp ConsoleCommands/ConsoleInterpreter_LuaBinding.cpp |
|---|
| 11 | ConsoleCommands/Console.cpp ConsoleCommands/Console_Lua.cpp ConsoleCommands/ConsoleComposite.cpp ConsoleCommands/ConsoleStdout.cpp ConsoleCommands/ConsoleStringBuffer.cpp ConsoleCommands/ConsoleWarningsOnly.cpp ConsoleCommands/ConsoleFile.cpp |
|---|
| 12 | Fonts/Font.cpp Fonts/FontTT.cpp |
|---|
| 13 | FileSys/FileManImpl.cpp FileSys/FileSys_LocalPath.cpp FileSys/FileSys_ZipArchive_GV.cpp FileSys/File_local.cpp FileSys/File_memory.cpp FileSys/Password.cpp |
|---|
| 14 | MapFile.cpp |
|---|
| 15 | Models/Loader.cpp Models/Loader_ase.cpp Models/Loader_cmdl.cpp Models/Loader_dlod.cpp Models/Loader_dummy.cpp Models/Loader_lwo.cpp Models/Loader_md5.cpp |
|---|
| 16 | Models/Loader_mdl.cpp Models/AnimExpr.cpp Models/AnimPose.cpp |
|---|
| 17 | Models/Model_cmdl.cpp Models/ModelManager.cpp |
|---|
| 18 | Network/Network.cpp Network/State.cpp ParticleEngine/ParticleEngineMS.cpp PlatformAux.cpp Terrain/Terrain.cpp |
|---|
| 19 | TextParser/TextParser.cpp |
|---|
| 20 | Plants/Tree.cpp Plants/PlantDescription.cpp Plants/PlantDescrMan.cpp |
|---|
| 21 | Util/Util.cpp |
|---|
| 22 | Win32/Win32PrintHelp.cpp |
|---|
| 23 | DebugLog.cpp TypeSys.cpp""")+ |
|---|
| 24 | Glob("GuiSys/*.cpp")+ |
|---|
| 25 | Glob("Math3D/*.cpp"), |
|---|
| 26 | CPPPATH=env['CPPPATH'] + ["#/ExtLibs/lua/src", "#/ExtLibs/lwo", "#/ExtLibs/jpeg"]) |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | # The model loader classes are in a separate library in order to not have to compile many unrelated source files |
|---|
| 31 | # with their header search paths, and to keep them from cfsLib, which is linked to Cafu with "--whole-archive" |
|---|
| 32 | # and thus would involve all related external libraries as well. |
|---|
| 33 | envModelLoaders = env.Clone() |
|---|
| 34 | |
|---|
| 35 | if os.path.exists(Dir("#/ExtLibs/fbx/include").abspath): |
|---|
| 36 | envModelLoaders.Append(CPPDEFINES=["HAVE_FBX_SDK"]) |
|---|
| 37 | envModelLoaders.Append(CPPPATH=["#/ExtLibs/fbx/include"]) |
|---|
| 38 | |
|---|
| 39 | envModelLoaders.StaticLibrary("ModelLoaders", ["Models/Loader_fbx.cpp"]) |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | # This library is obsolete, and only used for our legacy programs in CaTools. |
|---|
| 44 | if sys.platform=="win32": |
|---|
| 45 | env.StaticLibrary(target="cfsOpenGL", |
|---|
| 46 | source=["OpenGL/OpenGLWindow.cpp", "DirectX/DirectInput.cpp"], |
|---|
| 47 | CPPPATH=env['CPPPATH']+["#/ExtLibs/DirectX7/include"]) |
|---|
| 48 | else: |
|---|
| 49 | env.StaticLibrary(target="cfsOpenGL", source="OpenGL/OpenGLWindow.cpp") |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | env.StaticLibrary( |
|---|
| 54 | target="ClipSys", |
|---|
| 55 | source=Split("""ClipSys/CollisionModel_static.cpp ClipSys/CollisionModel_static_BulletAdapter.cpp ClipSys/CollisionModelMan_impl.cpp |
|---|
| 56 | ClipSys/ClipModel.cpp ClipSys/ClipWorld.cpp ClipSys/TraceSolid.cpp"""), |
|---|
| 57 | CPPPATH=env['CPPPATH']+["#/ExtLibs/bullet/src"]) |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | env.StaticLibrary( |
|---|
| 62 | target="MatSys", |
|---|
| 63 | source=Split("""MaterialSystem/Expression.cpp MaterialSystem/MapComposition.cpp MaterialSystem/Material.cpp |
|---|
| 64 | MaterialSystem/MaterialManagerImpl.cpp MaterialSystem/Renderer.cpp MaterialSystem/TextureMap.cpp""")) |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | env.StaticLibrary( |
|---|
| 69 | target="SoundSys", |
|---|
| 70 | source=Split("""SoundSystem/SoundShaderManagerImpl.cpp SoundSystem/SoundShader.cpp""")) |
|---|
| 71 | |
|---|
| 72 | |
|---|
| 73 | |
|---|
| 74 | env.StaticLibrary( |
|---|
| 75 | target="SceneGraph", |
|---|
| 76 | source=Split("""SceneGraph/_aux.cpp SceneGraph/BezierPatchNode.cpp SceneGraph/BspTreeNode.cpp SceneGraph/FaceNode.cpp |
|---|
| 77 | SceneGraph/LightMapMan.cpp SceneGraph/Node.cpp SceneGraph/SHLMapMan.cpp SceneGraph/TerrainNode.cpp |
|---|
| 78 | SceneGraph/PlantNode.cpp SceneGraph/ModelNode.cpp""")) |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | envRenderers = env.Clone() |
|---|
| 83 | |
|---|
| 84 | MatSys_CommonObjectsList = envRenderers.SharedObject(["MaterialSystem/Common/DepRelMatrix.cpp", "MaterialSystem/Common/OpenGLState.cpp", "MaterialSystem/Common/OpenGLEx.cpp"]) |
|---|
| 85 | |
|---|
| 86 | if sys.platform=="linux2": |
|---|
| 87 | envRenderers.Append(LINKFLAGS=["Libs/MaterialSystem/Common/linker-script"]) |
|---|
| 88 | |
|---|
| 89 | |
|---|
| 90 | |
|---|
| 91 | if sys.platform=="win32": |
|---|
| 92 | LibList=Split("cfsLib png cfs_jpeg z MatSys opengl32.lib glu32.lib") |
|---|
| 93 | else: |
|---|
| 94 | LibList=["GLU"] |
|---|
| 95 | |
|---|
| 96 | envRenderers.SharedLibrary( |
|---|
| 97 | target="MaterialSystem/RendererARBprogs", |
|---|
| 98 | source=[os.path.join("MaterialSystem/RendererARBprogs", x) for x in Split(""" |
|---|
| 99 | RendererARBprogs.cpp RendererImpl.cpp RenderMaterial.cpp Shader.cpp TextureMapImpl.cpp |
|---|
| 100 | |
|---|
| 101 | Shaders/A_Terrain.cpp Shaders/A_Diff.cpp Shaders/A_Diff_Luma.cpp Shaders/A_Diff_Norm.cpp Shaders/A_Diff_Norm_Luma.cpp |
|---|
| 102 | Shaders/A_Diff_Light.cpp Shaders/A_Diff_Light_Luma.cpp Shaders/A_Diff_Light_Norm.cpp Shaders/A_Diff_Light_Norm_Spec.cpp |
|---|
| 103 | Shaders/A_Diff_Light_Norm_Luma.cpp Shaders/A_Diff_Light_Norm_Luma_Spec.cpp |
|---|
| 104 | Shaders/A_SkyDome.cpp Shaders/A_Solid.cpp Shaders/A_WaterCubeReflect.cpp |
|---|
| 105 | Shaders/L_Diff.cpp Shaders/L_Diff_Spec.cpp Shaders/L_Diff_Norm.cpp Shaders/L_Diff_Norm_Spec.cpp |
|---|
| 106 | Shaders/StencilShadowVolumes.cpp |
|---|
| 107 | Shaders/_CommonHelpers.cpp""")] + |
|---|
| 108 | MatSys_CommonObjectsList, |
|---|
| 109 | LIBS=LibList) |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | |
|---|
| 113 | LibPath="#/ExtLibs/Cg/lib" |
|---|
| 114 | if sys.platform=="win32": |
|---|
| 115 | LibList=Split("cfsLib png cfs_jpeg z MatSys opengl32.lib glu32.lib cg cgGL") |
|---|
| 116 | if envRenderers["TARGET_ARCH"]!="x86": LibPath += ".x64" |
|---|
| 117 | elif sys.platform=="linux2": |
|---|
| 118 | LibList=Split("Cg CgGL GLU") |
|---|
| 119 | if platform.machine()=="x86_64": LibPath += ".x64" |
|---|
| 120 | else: |
|---|
| 121 | LibList=[] |
|---|
| 122 | |
|---|
| 123 | envRenderers.SharedLibrary( |
|---|
| 124 | target="MaterialSystem/RendererCgARB1", |
|---|
| 125 | source=[os.path.join("MaterialSystem/RendererCgARB1", x) for x in Split(""" |
|---|
| 126 | RendererCgARB1.cpp RendererImpl.cpp RenderMaterial.cpp Shader.cpp TextureMapImpl.cpp |
|---|
| 127 | |
|---|
| 128 | Shaders/A_Terrain.cpp Shaders/A_Diff.cpp Shaders/A_Diff_Luma.cpp Shaders/A_Diff_Norm.cpp Shaders/A_Diff_Norm_Luma.cpp |
|---|
| 129 | Shaders/A_Diff_Light.cpp Shaders/A_Diff_Light_Luma.cpp Shaders/A_Diff_Light_Norm.cpp Shaders/A_Diff_Light_Norm_Luma.cpp |
|---|
| 130 | Shaders/A_SkyDome.cpp Shaders/A_Solid.cpp Shaders/A_WaterCubeReflect.cpp Shaders/L_Diff.cpp Shaders/L_Diff_Spec.cpp |
|---|
| 131 | Shaders/L_Diff_Norm.cpp Shaders/L_Diff_Norm_Spec.cpp Shaders/StencilShadowVolumes.cpp Shaders/_CommonCgHelpers.cpp""")] + |
|---|
| 132 | MatSys_CommonObjectsList, |
|---|
| 133 | CPPPATH=env['CPPPATH']+["#/ExtLibs/Cg/include"], |
|---|
| 134 | LIBPATH=env['LIBPATH']+[LibPath], |
|---|
| 135 | LIBS=LibList) |
|---|
| 136 | |
|---|
| 137 | |
|---|
| 138 | |
|---|
| 139 | LibPath="#/ExtLibs/Cg/lib" |
|---|
| 140 | if sys.platform=="win32": |
|---|
| 141 | LibList=Split("cfsLib png cfs_jpeg z MatSys opengl32.lib glu32.lib cg cgGL") |
|---|
| 142 | if envRenderers["TARGET_ARCH"]!="x86": LibPath += ".x64" |
|---|
| 143 | elif sys.platform=="linux2": |
|---|
| 144 | LibList=Split("Cg CgGL GLU") |
|---|
| 145 | if platform.machine()=="x86_64": LibPath += ".x64" |
|---|
| 146 | else: |
|---|
| 147 | LibList=[] |
|---|
| 148 | |
|---|
| 149 | envRenderers.SharedLibrary( |
|---|
| 150 | target="MaterialSystem/RendererCgNV2X", |
|---|
| 151 | source=[os.path.join("MaterialSystem/RendererCgNV2X", x) for x in Split(""" |
|---|
| 152 | RendererCgNV2X.cpp RendererImpl.cpp RenderMaterial.cpp Shader.cpp TextureMapImpl.cpp |
|---|
| 153 | |
|---|
| 154 | Shaders/A_Terrain.cpp Shaders/A_Diff.cpp Shaders/A_Diff_Luma.cpp Shaders/A_Diff_Norm.cpp Shaders/A_Diff_Norm_Luma.cpp |
|---|
| 155 | Shaders/A_Diff_Light.cpp Shaders/A_Diff_Light_Luma.cpp Shaders/A_Diff_Light_Norm.cpp Shaders/A_Diff_Light_Norm_Luma.cpp |
|---|
| 156 | Shaders/A_SkyDome.cpp Shaders/A_Solid.cpp Shaders/A_WaterCubeReflect.cpp Shaders/L_Diff.cpp Shaders/L_Diff_Spec.cpp |
|---|
| 157 | Shaders/L_Diff_Norm_oSpec.cpp Shaders/StencilShadowVolumes.cpp Shaders/_CommonCgHelpers.cpp""")] + |
|---|
| 158 | MatSys_CommonObjectsList, |
|---|
| 159 | CPPPATH=env['CPPPATH']+["#/ExtLibs/Cg/include"], |
|---|
| 160 | LIBPATH=env['LIBPATH']+[LibPath], |
|---|
| 161 | LIBS=LibList) |
|---|
| 162 | |
|---|
| 163 | |
|---|
| 164 | |
|---|
| 165 | if sys.platform=="win32": |
|---|
| 166 | LibList=Split("cfsLib MatSys") |
|---|
| 167 | else: |
|---|
| 168 | LibList=[] |
|---|
| 169 | |
|---|
| 170 | envRenderers.SharedLibrary( |
|---|
| 171 | target="MaterialSystem/RendererNull", |
|---|
| 172 | source=[os.path.join("MaterialSystem/RendererNull", x) for x in Split("""RendererNull.cpp RendererImpl.cpp TextureMapImpl.cpp""")], |
|---|
| 173 | LIBS=LibList) |
|---|
| 174 | |
|---|
| 175 | |
|---|
| 176 | |
|---|
| 177 | if sys.platform=="win32": |
|---|
| 178 | LibList=Split("cfsLib png cfs_jpeg z MatSys opengl32.lib glu32.lib") |
|---|
| 179 | else: |
|---|
| 180 | LibList=["GLU"] |
|---|
| 181 | |
|---|
| 182 | envRenderers.SharedLibrary( |
|---|
| 183 | target="MaterialSystem/RendererOpenGL12", |
|---|
| 184 | source=[os.path.join("MaterialSystem/RendererOpenGL12", x) for x in Split(""" |
|---|
| 185 | RendererImpl.cpp RendererOpenGL12.cpp RenderMaterial.cpp Shader.cpp TextureMapImpl.cpp |
|---|
| 186 | |
|---|
| 187 | Shaders/A_Diff_Light_Fog.cpp Shaders/A_Diff_Light_oLuma.cpp Shaders/A_Diff_nLight_oLuma.cpp Shaders/A_SkyDome.cpp |
|---|
| 188 | Shaders/A_Solid.cpp Shaders/A_Terrain.cpp Shaders/A_WaterCubeReflect.cpp Shaders/L_Diff_oSpec.cpp Shaders/StencilShadowVolumes.cpp""")] + |
|---|
| 189 | MatSys_CommonObjectsList, |
|---|
| 190 | LIBS=LibList) |
|---|
| 191 | |
|---|
| 192 | |
|---|
| 193 | |
|---|
| 194 | envSoundSys = env.Clone() |
|---|
| 195 | |
|---|
| 196 | if sys.platform=="linux2": |
|---|
| 197 | envSoundSys.Append(LINKFLAGS=["Libs/SoundSystem/Common/linker-script"]) |
|---|
| 198 | |
|---|
| 199 | envSoundSys.SharedLibrary( |
|---|
| 200 | target="SoundSystem/SoundSysNull", |
|---|
| 201 | source=[os.path.join("SoundSystem/SoundSysNull", x) for x in Split("SoundSysImpl.cpp DllInterface.cpp")], |
|---|
| 202 | LIBS="SoundSys") |
|---|
| 203 | |
|---|
| 204 | |
|---|
| 205 | |
|---|
| 206 | envSoundSys = env.Clone() |
|---|
| 207 | envSoundSys.Append(CPPPATH=['#/ExtLibs/fmod/api/inc']) |
|---|
| 208 | |
|---|
| 209 | if sys.platform=="win32": |
|---|
| 210 | envSoundSys.Append(LIBPATH=['#/ExtLibs/fmod/api/lib']) |
|---|
| 211 | envSoundSys.Append(LIBS=Split("cfsLib SoundSys fmodvc")) |
|---|
| 212 | elif sys.platform=="linux2": |
|---|
| 213 | envSoundSys.Append(LINKFLAGS=["Libs/SoundSystem/Common/linker-script"]) |
|---|
| 214 | envSoundSys.Append(LIBPATH=['#/ExtLibs/fmod/api']) |
|---|
| 215 | envSoundSys.Append(LIBS=["SoundSys", "fmod-3.75"]) |
|---|
| 216 | |
|---|
| 217 | # We have the FMod libraries only for 32-bit platforms... |
|---|
| 218 | if (sys.platform=="win32" and envSoundSys["TARGET_ARCH"]=="x86") or (sys.platform=="linux2" and platform.machine()!="x86_64"): |
|---|
| 219 | envSoundSys.SharedLibrary( |
|---|
| 220 | target="SoundSystem/SoundSysFMOD3", |
|---|
| 221 | source=[os.path.join("SoundSystem/SoundSysFMOD3", x) for x in Split(""" |
|---|
| 222 | SoundSysImpl.cpp DllInterface.cpp SoundImpl.cpp BufferManager.cpp |
|---|
| 223 | StaticBuffer.cpp StreamingBuffer.cpp Channel.cpp""")]) |
|---|
| 224 | |
|---|
| 225 | |
|---|
| 226 | |
|---|
| 227 | envSoundSys = env.Clone() |
|---|
| 228 | envSoundSys.Append(CPPPATH=['#/ExtLibs/freealut/include', '#/ExtLibs/mpg123/src/libmpg123', '#/ExtLibs/libvorbis/include', '#/ExtLibs/libogg/include']) |
|---|
| 229 | |
|---|
| 230 | if sys.platform=="win32": |
|---|
| 231 | envSoundSys.Append(CPPPATH=['#/ExtLibs/openal-win/include']) |
|---|
| 232 | envSoundSys.Append(LIBS=Split("cfsLib SoundSys OpenAL32 alut mpg123 ogg vorbis vorbisfile")) |
|---|
| 233 | if envSoundSys["TARGET_ARCH"]=="x86": |
|---|
| 234 | envSoundSys.Append(LIBPATH=['#/ExtLibs/openal-win/libs/Win32']) |
|---|
| 235 | else: |
|---|
| 236 | envSoundSys.Append(LIBPATH=['#/ExtLibs/openal-win/libs/Win64']) |
|---|
| 237 | elif sys.platform=="linux2": |
|---|
| 238 | envSoundSys.Append(CPPPATH=['#/ExtLibs/openal-soft/include']) |
|---|
| 239 | envSoundSys.Append(LIBS=Split("openal alut mpg123 vorbisfile vorbis ogg")) |
|---|
| 240 | envSoundSys.Append(LINKFLAGS=["Libs/SoundSystem/Common/linker-script"]) |
|---|
| 241 | |
|---|
| 242 | envSoundSys.SharedLibrary( |
|---|
| 243 | target="SoundSystem/SoundSysOpenAL", |
|---|
| 244 | source=Glob("SoundSystem/Common/*.cpp")+ |
|---|
| 245 | Glob("SoundSystem/SoundSysOpenAL/*.cpp")) |
|---|