Skip to content

Instantly share code, notes, and snippets.

@jamesu
Last active September 10, 2023 21:44
Show Gist options
  • Save jamesu/4e4346837e9ae644b04d599ee1f23912 to your computer and use it in GitHub Desktop.
Save jamesu/4e4346837e9ae644b04d599ee1f23912 to your computer and use it in GitHub Desktop.
Torque3D premake build file. Generates a suitable project for T3D with premake.
-- premake5.lua
-- Project file creator for T3D
-- Usage: premake5 <toolchain>
-- (C)2016-2019 James S Urquhart. Feel free to use wherever.
--
-- Instructions:
-- * Copy Templates/Full to a folder in "My Projects"
-- * Change PROJECT_NAME to match this folder name
-- * Change WORKSPACE_NAME to your desired workspace name
-- * Grab a copy of premake5.exe from https://github.com/premake/premake-core/releases/download/v5.0.0-alpha13/premake-5.0.0-alpha13-windows.zip
-- * Save this file to premake5.lua in "My Projects" along with premake5.exe
-- * Run with "premake.exe vs2015" to generate VS2015 project files. You'll get a build folder with the project files in.
-- * Download SDL libs from http://libsdl.org/release/SDL2-devel-2.0.9-VC.zip and extract the lib folder to Engine/lib/sdl/
-- * Download SDL dll from http://libsdl.org/release/SDL2-2.0.9-win32-x64.zip and place in the game folder (grab 32bit one if building 32bit)
--
-- Commandline options on premake can be used to change project config.
-- Note that currently OpenGL builds are broken, only d3d11 is available. Only the 64bit build has been tested. Also only dsound and openal support is compiled in.
--
ENGINE_SRC_FOLDER = "../Engine/source/"
ENGINE_LIB_FOLDER = "../Engine/lib/"
-- Change these to match your project name
WORKSPACE_NAME = "Torque3DGame_WS"
PROJECT_NAME = "Torque3DGame"
PROJECT_GAME_NAME = PROJECT_NAME .. " Game"
PROJECT_EXE_NAME = PROJECT_NAME .. " EXE"
-- Change this if your game folder is different (for assets)
TORQUE_GAME_FOLDER = './' .. PROJECT_NAME
-- util funcs
function addEngineSrcDir(dir)
files { ENGINE_SRC_FOLDER .. dir .. "/*.c", ENGINE_SRC_FOLDER .. dir .. "/*.cpp", ENGINE_SRC_FOLDER .. dir .. "/*.cc", ENGINE_SRC_FOLDER .. dir .. "/*.h" }
end
function addEngineSrcDirRec(dir)
files { ENGINE_SRC_FOLDER .. dir .. "/**.c", ENGINE_SRC_FOLDER .. dir .. "/**.cpp", ENGINE_SRC_FOLDER .. dir .. "/**.cc", ENGINE_SRC_FOLDER .. dir .. "/**.h" }
end
function addEngineSrcFile(name)
files { ENGINE_SRC_FOLDER .. name .. ".*c", ENGINE_SRC_FOLDER .. name .. ".*cc", ENGINE_SRC_FOLDER .. name .. ".*cpp", ENGINE_SRC_FOLDER .. name .. "*h", }
end
function addLibSrcDir(dir)
files { ENGINE_LIB_FOLDER .. dir .. "/*.c", ENGINE_LIB_FOLDER .. dir .. "/*.cpp", ENGINE_LIB_FOLDER .. dir .. "/*.cc", ENGINE_LIB_FOLDER .. dir .. "/*.h" }
end
function addLibSrcFile(name)
files { ENGINE_LIB_FOLDER .. name .. ".*c", ENGINE_LIB_FOLDER .. name .. ".*cc", ENGINE_LIB_FOLDER .. name .. ".*", ENGINE_LIB_FOLDER .. name .. ".*h", }
end
function addLibSrcDirRec(dir)
files { ENGINE_LIB_FOLDER .. dir .. "/**.c", ENGINE_LIB_FOLDER .. dir .. "/**.cpp", ENGINE_LIB_FOLDER .. dir .. "/**.cc", ENGINE_LIB_FOLDER .. dir .. "/**.h" }
end
function addLibIncludePath(dir)
includedirs { ENGINE_LIB_FOLDER .. dir }
end
function addScriptFiles(dir)
files { dir .. "/**.cs", dir .. "/**.gui", dir .. "/**.mis", dir .. "/**.prefab", dir .. "/**.txt" }
end
function addOutputFilter(config_prefix, name, build_folder, target_dir, do_debug, do_release)
conf_rel_name = config_prefix .. 'Release'
conf_debug_name = config_prefix .. 'Debug'
if not (target_dir == nil) then
targetdir( target_dir )
end
objdir( build_folder )
if do_debug then
filter { "configurations:" .. conf_debug_name , "platforms:x32" }
if not (name == nil) then targetname( config_prefix .. name .. '_Debug32' ) end
if target_dir == nil then targetdir( build_folder .. '/out.32.Debug' ) end
filter {}
filter { "configurations:" .. conf_debug_name, "platforms:x64" }
if not (name == nil) then targetname( config_prefix .. name .. '_Debug64' ) end
if target_dir == nil then targetdir( build_folder .. '/out.64.Debug' ) end
filter {}
end
if do_release then
filter { "configurations:" .. conf_rel_name, "platforms:x32" }
if not (name == nil) then targetname( config_prefix .. name .. '_32' ) end
if target_dir == nil then targetdir( build_folder .. '/out.32.Release' ) end
filter {}
filter { "configurations:" .. conf_rel_name, "platforms:x64" }
if not (name == nil) then targetname( config_prefix .. name .. '_64' ) end
if target_dir == nil then targetdir( build_folder .. '/out.64.Release' ) end
filter {}
end
end
function setGameOutputPaths(name)
addOutputFilter( '', name, './Link/bin/vs2015', GAME_FOLDER, true, true )
addOutputFilter( 'Unoptimized ', name, './Link/bin/vs2015', GAME_FOLDER, false, true ) -- Unoptimized Release
addOutputFilter( 'Optimized ', name, './Link/bin/vs2015', GAME_FOLDER, true, false ) -- Optimized Debug
end
function setLibOutputPaths()
addOutputFilter( '', name, './Link/libs/vs2015', nil, true, true )
addOutputFilter( 'Unoptimized ', name, './Link/libs/vs2015', nil, false, true ) -- Unoptimized Release
addOutputFilter( 'Optimized ', name, './Link/libs/vs2015', nil, true, false ) -- Optimized Debug
end
function setDynamicLibOutputPaths(name)
addOutputFilter( '', name, './Link/libs/vs2015', GAME_FOLDER, true, true )
addOutputFilter( 'Unoptimized ', name, './Link/libs/vs2015', GAME_FOLDER, false, true ) -- Unoptimized Release
addOutputFilter( 'Optimized ', name, './Link/libs/vs2015', GAME_FOLDER, true, false ) -- Optimized Debug
end
-- Config
-- Set default values
GAME_SRC_FOLDER = "../My Projects/" .. PROJECT_NAME .. "/source"
GAME_FOLDER = "../My Projects/" .. PROJECT_NAME .. "/game"
TORQUE_TOOL_BUILD = true
TORQUE_EXTENDED_MOVE = false
TORQUE_BASIC_LIGHTING = true
TORQUE_ADVANCED_LIGHTING = true
TORQUE_GL = false
TORQUE_D3D11 = true
TORQUE_DSOUND = true
TORQUE_XAUDIO = false -- this seems to be broken
TORQUE_FMOD = false
TORQUE_FMOD_PATH = "../../Engine/lib/fmod"
TORQUE_OPENAL = true
TORQUE_AFX = true
TORQUE_PHYSICS_BULLET = false
TORQUE_OPENVR = false
TORQUE_OPENVR_SDK_PATH = "C:\\Dev\\openvr"
TORQUE_TESTING = false
TORQUE_SHARED = false
TORQUE_ADD_SCRIPTS = false
-- Specify commandline options
newoption {
trigger = "without-tools",
description = "Include tools"
}
newoption {
trigger = 'add-scripts',
description = 'Add scripts and text assets'
}
newoption {
trigger = "with-testing",
description = "Include testing code"
}
newoption {
trigger = "with-hifi-net",
description = "Include hifi net"
}
newoption {
trigger = "with-basic-lighting",
description = "Include basic lighting"
}
newoption {
trigger = "with-advanced-lighting",
description = "Include advanced lighting"
}
newoption {
trigger = "with-openvr",
description = "Include OpenVR"
}
newoption {
trigger = "with-afx",
description = "Include AFX"
}
newoption {
trigger = "move-system",
description = "Move system",
value = "type",
allowed = {
{ "normal-move", "Normal" },
{ "extended-move", "Extended move" },
}
}
newoption {
trigger = "with-d3d11",
description = "Include d3d11"
}
newoption {
trigger = "with-opengl",
description = "Include opengl"
}
newoption {
trigger = "with-dsound",
description = "DirectSound support"
}
newoption {
trigger = "with-xaudio",
description = "XAudio support"
}
newoption {
trigger = "with-fmod",
description = "FMOD support"
}
newoption {
trigger = "with-openal",
description = "OPENAL support"
}
newoption {
trigger = "with-shared-lib",
description = "Build as split shared lib & exe"
}
-- Set options based on input flags
if _OPTIONS["without-tools"] then
TORQUE_TOOL_BUILD = false
end
if _OPTIONS["with-hifi-net"] then
TORQUE_HIFI_NET = true
end
if _OPTIONS["with-openvr"] then
TORQUE_OPENVR = true
end
if _OPTIONS["move-system"] ~= "" then
TORQUE_EXTENDED_MOVE = _OPTIONS["move-system"] == "extended-move"
end
if _OPTIONS["with-d3d11"] then
TORQUE_D3D11 = true
end
if _OPTIONS["with-afx"] then
TORQUE_AFX = true
end
if _OPTIONS["with-gl"] then
TORQUE_GL = true
end
if _OPTIONS["with-basic-lighting"] then
TORQUE_BASIC_LIGHTING = true
end
if _OPTIONS["with-advanced-lighting"] then
TORQUE_ADVANCED_LIGHTING = true
end
if _OPTIONS["with-dsound"] then
TORQUE_DSOUND = true
end
if _OPTIONS["with-xaudio"] then
TORQUE_XAUDIO = true
end
if _OPTIONS["with-fmod"] then
TORQUE_FMOD = true
end
if _OPTIONS["with-openal"] then
TORQUE_OPENAL = true
end
if _OPTIONS["with-scripts"] then
TORQUE_ADD_SCRIPTS = true
end
if _OPTIONS["with-testing"] then
TORQUE_TESTING = true
end
if _OPTIONS["with-shared-lib"] then
TORQUE_SHARED = true
end
if TORQUE_D3D11 then
TORQUE_D3D = true
end
-- Start
location "build"
workspace(WORKSPACE_NAME)
configurations { "Debug", "Release", "Optimized Debug", "Unoptimized Release" }
platforms { "x32", "x64" }
disablewarnings { '4244', '4018', '4267', '4800' }
flags { "MultiProcessorCompile" }
nativewchar "off"
filter "system:windows"
defines { "WIN32" }
defines { "UNICODE" }
defines { "INITGUID" }
defines { "_CRT_SECURE_NO_DEPRECATE", '_CRT_SECURE_NO_WARNINGS' }
defines { 'WINDOWS', '_WINDOWS', '_UNICODE' }
linkoptions { "/LARGEADDRESSAWARE" }
filter {}
--- Generic config
filter { "platforms:x32" }
system "Windows"
architecture "x32"
filter {}
filter { "platforms:x64" }
system "Windows"
architecture "x64"
defines { "UNICODE" }
defines { "INITGUID" }
defines { "_CRT_SECURE_NO_DEPRECATE" }
filter {}
filter { "configurations:*Debug" }
defines { "TORQUE_DEBUG" }
defines { "TORQUE_SHADERGEN" }
defines { "TORQUE_UNICODE" }
defines { "TORQUE_MULTITHREAD" }
optimize "Debug"
symbols "On"
symbolspath "$(OutDir)$(TargetName).pdb"
filter {}
filter { "configurations:*Release" }
defines { "TORQUE_RELEASE" }
defines { "NDEBUG" }
defines { "TORQUE_SHADERGEN" }
defines { "TORQUE_UNICODE" }
defines { "TORQUE_MULTITHREAD" }
optimize "On"
symbols "On"
symbolspath "$(OutDir)$(TargetName).pdb"
filter {}
filter { "configurations:Optimized Debug" }
optimize "On"
filter { }
filter { "configurations:Unoptimized Release" }
optimize "Off"
filter { }
-- Targets
-- EXE needs to be separate. Thankfully though we don't need that much setup here
-- Note ideally we should make a separate solution for this
if TORQUE_SHARED then
project(PROJECT_EXE_NAME)
language "C++"
kind "WindowedApp"
targetdir "../bin/%{cfg.buildcfg}"
entrypoint "WinMainCRTStartup"
defines { "TORQUE_SHARED" }
addEngineSrcDir('main')
includedirs { ENGINE_SRC_FOLDER }
includedirs { ENGINE_LIB_FOLDER }
-- Needs to be source dir
includedirs { GAME_SRC_FOLDER }
filter { "configurations:*Debug" }
symbols "Off"
symbolspath "$(OutDir)$(TargetName)_EXE.pdb"
filter {}
filter { "configurations:*Release" }
symbolspath "$(OutDir)$(TargetName)_EXE.pdb"
filter {}
setGameOutputPaths('TorqueGame')
dependson { PROJECT_GAME_NAME }
end
-- Gane stuff is here
project(PROJECT_GAME_NAME)
filter { "options:with-shared-lib" }
kind "SharedLib"
filter {}
filter { "options:not with-shared-lib" }
kind "WindowedApp"
filter {}
language "C++"
targetdir "../bin/%{cfg.buildcfg}"
flags { "WinMain" }
-- core libs
links {
'COMCTL32.LIB',
'USER32.LIB',
'ADVAPI32.LIB',
'GDI32.LIB',
'WINMM.LIB',
'WS2_32.LIB',
'vfw32.lib',
'Imm32.lib',
'ole32.lib',
'shell32.lib',
'oleaut32.lib',
'version.lib',
'legacy_stdio_definitions.lib'
}
-- sources
addEngineSrcDir('collision')
addEngineSrcDir('materials')
addEngineSrcDir('lighting')
addEngineSrcDir('lighting/common')
addEngineSrcDir('renderInstance')
addEngineSrcDir('scene')
addEngineSrcDir('scene/culling')
addEngineSrcDir('scene/zones')
addEngineSrcDir('scene/mixin')
addEngineSrcDir('shaderGen')
addEngineSrcDir('terrain')
addEngineSrcDir('environment')
addEngineSrcDir('forest')
addEngineSrcDir('forest/ts')
if TORQUE_TOOL_BUILD then
addEngineSrcDir('forest/editor') -- tool
end
addEngineSrcDir('ts')
addEngineSrcDir('ts/arch')
addEngineSrcDir('physics')
addEngineSrcDir('gui/3d')
addEngineSrcDir('postFx' )
addEngineSrcDir('assets')
addEngineSrcDir('module')
addEngineSrcDir('persistence/rapidjson')
addEngineSrcDir('persistence/taml')
addEngineSrcDir('persistence/taml/binary')
addEngineSrcDir('persistence/taml/json')
addEngineSrcDir('persistence/taml/xml')
-- 3D game
addEngineSrcDir('T3D')
addEngineSrcDirRec('T3D/components')
addEngineSrcDirRec('T3D/systems')
addEngineSrcDir('T3D/examples')
addEngineSrcDir('T3D/fps')
addEngineSrcDir('T3D/fx')
addEngineSrcDir('T3D/vehicles')
addEngineSrcDir('T3D/physics')
addEngineSrcDir('T3D/decal')
addEngineSrcDir('T3D/sfx')
addEngineSrcDir('T3D/gameBase')
addEngineSrcDir('T3D/turret')
addEngineSrcDir('T3D/assets')
-- AFX
if TORQUE_AFX
addEngineSrcDirRec('afx')
defines { 'TORQUE_AFX_ENABLED' }
end
-- Shared lib build option
filter { "options:not with-shared-lib" }
addEngineSrcDir('main')
filter {}
filter { "options:with-shared-lib" }
defines { "TORQUE_SHARED" }
filter {}
defines { "TORQUE_SDL" }
-- Script files
if TORQUE_ADD_SCRIPTS
addScriptFiles(TORQUE_GAME_FOLDER)
end
--
if ( TORQUE_HIFI_NET ) then
defines { 'TORQUE_HIFI_NET' }
addEngineSrcDir('T3D/gameBase/hifi')
elseif ( TORQUE_EXTENDED_MOVE ) then
defines { 'TORQUE_EXTENDED_MOVE' }
addEngineSrcDir('T3D/gameBase/extended')
else
addEngineSrcDir('T3D/gameBase/std')
end
-- OpenVR Support
if TORQUE_OPENVR then
addEngineSrcDir('platform/input/openvr')
includedirs { TORQUE_OPENVR_SDK_PATH .. '\\headers' }
filter "platforms:x32"
libdirs { TORQUE_OPENVR_SDK_PATH .. '\\lib\\win32' }
filter "platforms:x64"
libdirs { TORQUE_OPENVR_SDK_PATH .. '\\lib\\win64' }
filter {}
links { "openvr_api" }
defines { "TORQUE_OPENVR" }
end
-- terrain, forest shaders
if TORQUE_GL then
addEngineSrcDir( 'terrain/glsl' )
addEngineSrcDir( 'forest/glsl' )
end
if TORQUE_D3D then
addEngineSrcDir( 'terrain/hlsl' )
addEngineSrcDir( 'forest/hlsl' )
end
-- Advanced lighting
if ( TORQUE_ADVANCED_LIGHTING ) then
defines { "TORQUE_ADVANCED_LIGHTING" }
addEngineSrcDir( 'lighting/advanced' )
addEngineSrcDir( 'lighting/shadowMap' )
if TORQUE_GL then
addEngineSrcDir( 'lighting/advanced/glsl' )
end
if TORQUE_D3D then
addEngineSrcDir( 'lighting/advanced/hlsl' )
end
end
-- Basic lighting
if ( TORQUE_BASIC_LIGHTING ) then
defines { 'TORQUE_BASIC_LIGHTING' }
addEngineSrcDir( 'lighting/basic' )
addEngineSrcDir( 'lighting/shadowMap' )
end
-- Bullet physics
if TORQUE_PHYSICS_BULLET then
defines { "TORQUE_PHYSICS_BULLET" }
defines { "TORQUE_PHYSICS_ENABLED" }
addEngineSrcDir( "T3D/physics/bullet" )
addLibIncludePath( 'bullet/src' )
end
if TORQUE_TESTING then
defines { 'TORQUE_TESTS_ENABLED', '_VARIADIC_MAX=10' }
addEngineSrcDirRec("testing")
addLibIncludePath( 'gtest/fused-src' )
end
-- core.inc port
addEngineSrcDir('sfx/media')
addEngineSrcDir('sfx/null')
addEngineSrcDir('sfx')
-- Components
addEngineSrcDir('component')
addEngineSrcDir('component/interfaces')
-- Core
addEngineSrcDir('console')
addEngineSrcDir('core')
addEngineSrcDir('core/stream')
addEngineSrcDir('core/strings')
addEngineSrcDir('core/util')
addEngineSrcDir('core/util/journal')
addEngineSrcDir('core/util/zip')
addEngineSrcDir('core/util/zip/compressors')
addEngineSrcDir('i18n')
addEngineSrcDir('sim')
addEngineSrcDir('util')
addEngineSrcDir('windowManager')
addEngineSrcDir('windowManager/torque')
addEngineSrcDir('math')
addEngineSrcDir('math/util')
addEngineSrcDir('platform')
addEngineSrcDir('cinterface')
-- switch was here
addEngineSrcDir('platform/nativeDialogs')
addEngineSrcDir('platform/menus')
-- Testing code (all lumped here)
if TORQUE_TESTING then
addEngineSrcDir('component/test')
addEngineSrcDir('core/util/test')
addEngineSrcDir('core/util/journal/test')
addEngineSrcDir('core/util/zip/test')
addEngineSrcDir('math/test')
addEngineSrcDir('windowManager/test')
addEngineSrcDir('platform/test')
addEngineSrcDir('platform/threads/test')
addEngineSrcDir('platform/async/test')
end
addEngineSrcDir('platform/threads')
addEngineSrcDir('platform/async')
addEngineSrcDir('platform/input')
addEngineSrcDir('platform/output')
addEngineSrcDir('app')
addEngineSrcDir('app/net')
-- Moved this here temporarily because PopupMenu uses on it and is currently in core
addEngineSrcDir('util/messaging')
-- GFX
addEngineSrcDir( 'gfx/Null' )
addEngineSrcDir( 'gfx/bitmap' )
addEngineSrcDir( 'gfx/bitmap/loaders' )
addEngineSrcDir( 'gfx/util' )
addEngineSrcDir( 'gfx/video' )
addEngineSrcDir( 'gfx' )
addEngineSrcDir( 'shaderGen' )
if TORQUE_D3D then
addEngineSrcDir( 'shaderGen/HLSL' )
defines { 'TORQUE_D3D' }
end
if TORQUE_D3D11 then
addEngineSrcDir( 'gfx/D3D11' )
links { 'd3d11.lib' }
defines { 'TORQUE_D3D11' }
end
if TORQUE_GL then
addEngineSrcDir( 'gfx/gl' ) -- TODO
defines { 'TORQUE_GL', 'TORQUE_OPENGL', 'GLEW_STATIC' }
addEngineSrcDir("gfx/gl")
addEngineSrcDir("gfx/gl/tGL")
filter "platforms:Win32 or Win64"
addEngineSrcDir("gfx/gl/win32")
filter {}
addEngineSrcDir("shaderGen/GLSL")
addEngineSrcDir("lighting/advanced/glsl")
addEngineSrcDir("terrain/glsl")
addEngineSrcDir("forest/glsl")
links { "OpenGL32.lib" }
end
-- GFX - Sim dependent
addEngineSrcDir( 'gfx/sim')
-- GUI
addEngineSrcDir('gui/buttons')
addEngineSrcDir('gui/containers')
addEngineSrcDir('gui/controls')
addEngineSrcDir('gui/core')
addEngineSrcDir('gui/game')
addEngineSrcDir('gui/shiny')
addEngineSrcDir('gui/utility')
addEngineSrcDir('gui')
-- Include tools for non-tool builds (or define player if a tool build)
if TORQUE_TOOL_BUILD then
addEngineSrcDir('gui/worldEditor')
addEngineSrcDir('gui/worldEditor/tools')
addEngineSrcDir('environment/editors')
addEngineSrcDir('forest/editor')
addEngineSrcDir('gui/editor')
addEngineSrcDir('gui/editor/inspector')
else
defines { 'TORQUE_PLAYER' }
end
if TORQUE_DSOUND then
filter "system:windows"
addEngineSrcDir('sfx/dsound')
links { 'dsound.lib' }
filter {}
end
if TORQUE_XAUDIO then
filter "system:windows"
addEngineSrcDir('sfx/xaudio')
links { 'x3daudio.lib' }
filter {}
end
if TORQUE_FMOD then
if TORQUE_FMOD_PATH ~= "" then
addEngineSrcDir('sfx/fmod')
includedirs {
TORQUE_FMOD_PATH .. "/inc",
}
-- TODO: copy dlls fmodex fmod_event
end
end
if TORQUE_OPENAL then
addEngineSrcDir('sfx/openal')
filter "system:windows"
addEngineSrcDir('sfx/openal/win32')
includedirs { ENGINE_LIB_FOLDER .. '/openal-soft/include' }
filter {}
end
includedirs { ENGINE_SRC_FOLDER }
includedirs { ENGINE_LIB_FOLDER }
includedirs { ENGINE_LIB_FOLDER .. "/sdl/include" }
-- Needs to be source dir
includedirs { GAME_SRC_FOLDER }
setGameOutputPaths('TorqueGame')
-- win32 platform
filter "system:windows"
addEngineSrcDir("windowManager/sdl")
addEngineSrcDir("platformWin32")
addEngineSrcDir("platformWin32/nativeDialogs")
addEngineSrcDir("platformWin32/menus")
addEngineSrcDir("platformWin32/videoInfo")
addEngineSrcDir("platformWin32/minidump")
addEngineSrcDir("platformSDL")
addEngineSrcDir("platformSDL/threads")
filter "platforms:x32"
libdirs { ENGINE_LIB_FOLDER .. '\\sdl\\lib\\x86' }
filter "platforms:x64"
libdirs { ENGINE_LIB_FOLDER .. '\\sdl\\lib\\x64' }
filter {}
links { "SDL2", "SDL2main" }
removefiles { ENGINE_SRC_FOLDER .. "platformWin32/nativeDialogs/fileDialog.cpp" }
removefiles { ENGINE_SRC_FOLDER .. "platformSDL/sdlPlatformGL.cpp" }
filter {}
-- Mainly libs
project("collada_dom")
kind "StaticLib"
language "C++"
addLibSrcDir( 'collada/src/1.4/dom' )
addLibSrcDir( 'collada/src/dae' )
addLibSrcDir( 'collada/src/modules/LIBXMLPlugin' )
addLibSrcDir( 'collada/src/modules/stdErrPlugin' )
addLibSrcDir( 'collada/src/modules/STLDatabase' )
-- Additional includes
addLibIncludePath( 'collada/include' )
addLibIncludePath( 'collada/include/1.4' )
addLibIncludePath( "pcre" )
addLibIncludePath( "tinyxml" )
setLibOutputPaths()
links { "pcre" }
-- App config
project(PROJECT_GAME_NAME)
links { "collada_dom" }
addLibIncludePath( 'collada/include' )
addLibIncludePath( 'collada/include/1.4' )
-- global config
workspace(WORKSPACE_NAME)
defines { 'TORQUE_COLLADA', 'DOM_INCLUDE_TINYXML', 'PCRE_STATIC' }
-- torque3d project
project(PROJECT_GAME_NAME)
addEngineSrcDir( 'ts/collada' )
addEngineSrcDir( 'ts/loader' )
project("convexDecomp")
kind "StaticLib"
language "C++"
addLibSrcDir( 'convexDecomp' )
setLibOutputPaths()
-- App config
project(PROJECT_GAME_NAME)
links { "convexDecomp" }
-- global config
workspace(WORKSPACE_NAME)
addLibIncludePath( 'convexDecomp' )
if TORQUE_PHYSICS_BULLET then
project("libbullet")
kind "StaticLib"
language "C++"
-- Source
addLibSrcDir( 'bullet/src' )
addLibSrcDir( 'bullet/src/BulletCollision' )
addLibSrcDir( 'bullet/src/BulletCollision/BroadphaseCollision' )
addLibSrcDir( 'bullet/src/BulletCollision/CollisionDispatch' )
addLibSrcDir( 'bullet/src/BulletCollision/CollisionShapes' )
addLibSrcDir( 'bullet/src/BulletCollision/Gimpact' )
addLibSrcDir( 'bullet/src/BulletCollision/NarrowPhaseCollision' )
addLibSrcDir( 'bullet/src/BulletDynamics' )
addLibSrcDir( 'bullet/src/BulletDynamics/Character' )
addLibSrcDir( 'bullet/src/BulletDynamics/ConstraintSolver' )
addLibSrcDir( 'bullet/src/BulletDynamics/Dynamics' )
addLibSrcDir( 'bullet/src/BulletDynamics/Vehicle' )
addLibSrcDir( 'bullet/src/LinearMath' )
filter "system:windows"
addLibSrcDir( 'bullet/src/BulletMultiThreaded' )
addLibSrcDir( 'bullet/src/BulletMultiThreaded/MiniCLTask' )
addLibSrcDir( 'bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask' )
addLibIncludePath( 'bullet/src/BulletMultiThreaded/vectormath/scalar/cpp' )
filter {}
setLibOutputPaths()
-- App config
project(PROJECT_GAME_NAME)
links { "libbullet" }
end
project "libogg"
kind "StaticLib"
language "C"
addLibSrcDir( 'libogg/src' )
addLibSrcDir( 'libogg/include/ogg' )
addLibIncludePath( 'libogg/include' )
setLibOutputPaths()
-- App config
project(PROJECT_GAME_NAME)
links { "libogg" }
addLibIncludePath( 'libogg/include' )
--project "libtheora"
-- kind "StaticLib"
-- language "C"
project "libvorbis"
kind "StaticLib"
language "C"
addLibSrcDirRec( 'libvorbis' )
addLibIncludePath( 'libogg/include' )
addLibIncludePath( 'libvorbis/include' )
setLibOutputPaths()
-- App config
project(PROJECT_GAME_NAME)
links { "libvorbis" }
addLibIncludePath( 'libvorbis/include' )
-- global config
workspace(WORKSPACE_NAME)
defines { 'TORQUE_OGGVORBIS' }
project "ljpeg"
kind "StaticLib"
language "C"
addLibSrcDir( 'ljpeg' )
setLibOutputPaths()
-- App config
project(PROJECT_GAME_NAME)
links { "ljpeg" }
-- global config
workspace(WORKSPACE_NAME)
addLibIncludePath( 'ljpeg' )
project "nativeFileDialogs"
kind "StaticLib"
language "C++"
files {
ENGINE_LIB_FOLDER .. 'nativeFileDialogs/nfd_common.c',
ENGINE_LIB_FOLDER .. 'nativeFileDialogs/nfd_win.cpp' }
addLibIncludePath( 'nativeFileDialogs/include' )
setLibOutputPaths()
-- App config
project(PROJECT_GAME_NAME)
addLibIncludePath( 'nativeFileDialogs/include' )
links { "nativeFileDialogs" }
project "opcode"
kind "StaticLib"
language "C++"
-- Source
addLibSrcDir( 'opcode' )
addLibSrcDir( 'opcode/Ice' )
setLibOutputPaths()
-- App config
project(PROJECT_GAME_NAME)
links { "opcode" }
-- global config
workspace(WORKSPACE_NAME)
defines { 'TORQUE_OPCODE', 'ICE_NO_DLL', 'BAN_OPCODE_AUTOLINK' }
-- Additional includes
addLibIncludePath( 'opcode' )
project "pcre"
kind "StaticLib"
language "C++"
addLibSrcDir( 'pcre' )
addLibIncludePath( 'pcre' )
defines { 'PCRE_STATIC', 'HAVE_CONFIG_H' }
setLibOutputPaths()
-- App config
project(PROJECT_GAME_NAME)
defines { 'PCRE_STATIC' } -- in case we get pcre headers added
-- Collada config
project "collada_dom"
defines { 'PCRE_STATIC', 'HAVE_CONFIG_H' }
project "squish"
kind "StaticLib"
language "C++"
addLibSrcDir( 'squish' )
setLibOutputPaths()
-- Global config
workspace(WORKSPACE_NAME)
addLibIncludePath( 'squish' )
-- App config
project(PROJECT_GAME_NAME)
links { "squish" }
project "tinyxml"
kind "StaticLib"
language "C++"
addLibSrcDir( 'tinyxml' )
setLibOutputPaths()
-- App config
project(PROJECT_GAME_NAME)
links { "tinyxml" }
addLibIncludePath( "tinyxml" )
project "zlib"
kind "StaticLib"
language "C"
addLibSrcDir( 'zlib' )
setLibOutputPaths()
-- App config
project(PROJECT_GAME_NAME)
links { "zlib" }
-- Global config
workspace(WORKSPACE_NAME)
addLibIncludePath( 'zlib' )
project "lpng"
kind "StaticLib"
language "C"
addLibSrcDir( 'lpng' )
setLibOutputPaths()
-- App config
project(PROJECT_GAME_NAME)
links { "lpng" }
-- Global config
project(PROJECT_GAME_NAME)
addLibIncludePath( 'lpng' )
if TORQUE_GL then
project(epoxy)
kind "StaticLib"
language "C"
addLibSrcDir( 'epoxy/src' )
addLibIncludePath( 'epoxy/src' )
addLibIncludePath( 'epoxy/include' )
filter "platforms:Win32 or Win64"
addLibSrcDir( 'epoxy/src/wgl' )
defines { 'BUILD_WGL' }
filter {}
setLibOutputPaths()
-- App config
project(PROJECT_GAME_NAME)
links { "epoxy" }
-- Global config
project(PROJECT_GAME_NAME)
addLibIncludePath( 'epoxy/include' )
addLibIncludePath( 'epoxy/src' )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment