iw4x-client/premake/pdcurses.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
1.0 KiB
Lua

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