iw4x-client/premake/libtommath.lua
/dev/urandom 7ff05580c9
Premake: Split up dependencies, make them easily configurable and provide easy-to-use imports.
All dependency projects are now separated into their own Premake scripts and are designed to provide easy "import", "includes" and "setup" functions.

First, you use project.setup { ... } to provide the library with its respective configuration, this MAY include defines and MUST include the source path of that specific library. Then you can use project.includes() or project.import() in your target application or library project to let the script configure your project. This will configure all necessary include directories and links.
2016-08-13 19:45:11 +02:00

49 lines
1019 B
Lua

libtommath = {
settings = nil
}
function libtommath.setup(settings)
if not settings.source then error("Missing source") end
libtommath.settings = settings
if not libtommath.settings.defines then libtommath.settings.defines = {} end
end
function libtommath.import()
if not libtommath.settings then error("Run libtommath.setup first") end
links { "libtommath" }
libtommath.includes()
end
function libtommath.includes()
if not libtommath.settings then error("Run libtommath.setup first") end
defines(libtommath.settings.defines)
includedirs { libtommath.settings.source }
end
function libtommath.project()
if not libtommath.settings then error("Run libtommath.setup first") end
project "libtommath"
language "C"
libtommath.includes()
files
{
path.join(libtommath.settings.source, "*.c"),
}
-- dependencies
libtommath.import()
-- not our code, ignore POSIX usage warnings for now
warnings "Off"
defines { "_LIB" }
removedefines { "_DLL", "_USRDLL" }
kind "StaticLib"
end