mirror of
https://github.com/ctruLua/ctruLua.git
synced 2025-10-28 00:39:30 +00:00
Moved lzlib to the libs directory (cleaner)
This commit is contained in:
parent
406e17d321
commit
4aad32d5ab
23 changed files with 2593 additions and 991 deletions
58
libs/lzlib/lakefile
Normal file
58
libs/lzlib/lakefile
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
PROJECT = 'zlib'
|
||||
|
||||
IF=choose
|
||||
J=path.join
|
||||
|
||||
if LUA_VER == '5.2' then
|
||||
LUA_NEED = 'lua52'
|
||||
LUA_DIR = ENV.LUA_DIR_5_2 or ENV.LUA_DIR
|
||||
LUA_RUNNER = 'lua52'
|
||||
else
|
||||
LUA_NEED = 'lua'
|
||||
LUA_DIR = ENV.LUA_DIR
|
||||
LUA_RUNNER = 'lua'
|
||||
end
|
||||
|
||||
DYNAMIC = DYNAMIC or false
|
||||
|
||||
ZLIB_NEED = IF(DYNAMIC, 'zlib-static-md', 'zlib-static-mt')
|
||||
|
||||
INSTALL_DIR = INSTALL_DIR or J(LUA_DIR,'libs',PROJECT)
|
||||
|
||||
build = c.shared{PROJECT,
|
||||
-- base = 'src',
|
||||
src = '*.c',
|
||||
needs = { LUA_NEED, ZLIB_NEED },
|
||||
dynamic = DYNAMIC,
|
||||
strip = true,
|
||||
defines = IF(MSVC, "STRUCT_INT=__int64"),
|
||||
libflags = IF(MSVC, "/EXPORT:luaopen_" .. PROJECT),
|
||||
}
|
||||
|
||||
target('build', build)
|
||||
|
||||
install = target('install', {
|
||||
file.group{odir=J(INSTALL_DIR, 'share');src = build };
|
||||
file.group{odir=J(INSTALL_DIR, 'share');src = 'gzip.lua' };
|
||||
file.group{odir=J(INSTALL_DIR, 'test'); src = 'test_*.lua'};
|
||||
})
|
||||
|
||||
local function run(file, cwd)
|
||||
print()
|
||||
print("run " .. file)
|
||||
if not TESTING then
|
||||
if cwd then lake.chdir(cwd) end
|
||||
os.execute( LUA_RUNNER .. ' ' .. file )
|
||||
if cwd then lake.chdir("<") end
|
||||
print()
|
||||
end
|
||||
end
|
||||
|
||||
target('test', install, function()
|
||||
local test_dir = J(INSTALL_DIR,'test')
|
||||
run(J(test_dir,'test_zlib3.lua'), test_dir)
|
||||
run(J(test_dir,'test_zlib2.lua'), test_dir)
|
||||
run(J(test_dir,'test_prologue.lua'), test_dir)
|
||||
run(J(test_dir,'test_gzip.lua'), test_dir)
|
||||
end)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue