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

52 lines
941 B
Lua

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