iw4x-client/premake/mongoose.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

43 lines
884 B
Lua

mongoose = {
settings = nil,
}
function mongoose.setup(settings)
if not settings.source then error("Missing source.") end
mongoose.settings = settings
end
function mongoose.import()
if not mongoose.settings then error("Run mongoose.setup first") end
links { "mongoose" }
mongoose.includes()
end
function mongoose.includes()
if not mongoose.settings then error("Run mongoose.setup first") end
includedirs { mongoose.settings.source }
end
function mongoose.project()
if not mongoose.settings then error("Run mongoose.setup first") end
project "mongoose"
language "C"
mongoose.includes()
files
{
path.join(mongoose.settings.source, "*.c"),
path.join(mongoose.settings.source, "*.h"),
}
-- not our code, ignore POSIX usage warnings for now
warnings "Off"
-- always build as static lib, as mongoose doesn't export anything
kind "StaticLib"
end