2016-08-13 13:24:02 -04:00
|
|
|
zlib = {
|
|
|
|
settings = nil
|
|
|
|
}
|
|
|
|
|
|
|
|
function zlib.setup(settings)
|
|
|
|
if not settings.source then error("Missing source.") end
|
|
|
|
|
|
|
|
zlib.settings = settings
|
|
|
|
|
|
|
|
if not zlib.settings.defines then zlib.settings.defines = {} end
|
|
|
|
end
|
|
|
|
|
|
|
|
function zlib.import()
|
|
|
|
if not zlib.settings then error("You need to call zlib.setup first") end
|
|
|
|
|
|
|
|
links { "zlib" }
|
|
|
|
zlib.includes()
|
|
|
|
end
|
|
|
|
|
|
|
|
function zlib.includes()
|
|
|
|
if not zlib.settings then error("You need to call zlib.setup first") end
|
|
|
|
|
|
|
|
includedirs { zlib.settings.source }
|
2016-11-02 13:44:20 -04:00
|
|
|
defines { "ssize_t=int" }
|
2016-08-13 13:24:02 -04:00
|
|
|
defines(zlib.settings.defines)
|
|
|
|
end
|
|
|
|
|
|
|
|
function zlib.project()
|
|
|
|
if not zlib.settings then error("You need to call zlib.setup first") end
|
|
|
|
|
|
|
|
project "zlib"
|
|
|
|
language "C"
|
|
|
|
|
|
|
|
zlib.includes()
|
|
|
|
files
|
|
|
|
{
|
|
|
|
path.join(zlib.settings.source, "*.h"),
|
|
|
|
path.join(zlib.settings.source, "*.c"),
|
|
|
|
}
|
|
|
|
defines
|
|
|
|
{
|
|
|
|
"ZLIB_DLL",
|
|
|
|
"_CRT_SECURE_NO_DEPRECATE",
|
|
|
|
}
|
|
|
|
|
|
|
|
-- not our code, ignore POSIX usage warnings for now
|
|
|
|
warnings "Off"
|
|
|
|
|
|
|
|
kind "SharedLib"
|
2016-09-17 08:03:59 -04:00
|
|
|
--configuration "*Static"
|
2016-08-13 13:24:02 -04:00
|
|
|
defines { "_LIB" }
|
|
|
|
removedefines { "_USRDLL", "_DLL", "ZLIB_DLL" }
|
|
|
|
kind "StaticLib"
|
|
|
|
end
|