-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathlakefile
70 lines (60 loc) · 2.09 KB
/
lakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
if not WINDOWS then quit('This is only windows module!') end
PROJECT = 'winreg'
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 = 'lua51'
LUA_DIR = ENV.LUA_DIR
LUA_RUNNER = 'lua'
end
ROOT = ROOT or J(LUA_DIR, 'libs', PROJECT)
LUADIR = LUADIR or J(ROOT, 'share')
LIBDIR = LIBDIR or J(ROOT, 'share')
DYNAMIC = as_bool(DYNAMIC, false)
WINVER = IF(WINDOWS, WINVER or '501', '')
lake.define_need('unicode',function()return{
defines = {"UNICODE"; "_UNICODE"};
flags = "/UMBS /U_MBS";
} end)
INSTALL_DIR = INSTALL_DIR or J(LUA_DIR,'libs','winreg')
winreg = c.shared{'winreg',
base = 'src';
src = {"lua_int64","lua_mtutil","lua_tstring","luawin_dllerror",
"win_privileges","win_registry","win_trace","winreg","l52util"
};
defines = L(
{'WIN32','_WIN32','_WINDOWS'},
{"WIN32_LEAN_AND_MEAN"; "WINDLL"; "USRDLL"},
IF(DEBUG, {'_DEBUG', 'DEBUG'},'NDEBUG'),
IF(MSVC, {'_CRT_SECURE_NO_WARNINGS'}),
IF(MSVC, {'_WIN32_WINNT=0x0400','WINVER=0x0400', '_WIN32_IE=0x0300'}),
IF(MSVC, {'CRTAPI1=_cdecl','CRTAPI2=_cdecl','_X86_=1'}),
'WINREG_EXPORTS', 'WINREG_API=__declspec(dllexport)'
);
flags = IF(MSVC,
IF(DEBUG, {'-Z7' , '-Od', --[['-MLd']]}, {'-O2', --[['-ML']]}),
'-Os -DNDEBUG -s'
);
libflags = IF(MSVC and DEBUG, '-debug:full -debugtype:cv', '-DEBUG -OPT:REF -OPT:ICF');
needs = {LUA_NEED,IF(UNICODE, 'unicode')};
libs = {"advapi32", "kernel32", "user32"};
optimize = false;
dynamic = DYNAMIC;
}
target('build',{winreg})
install = target('install', {
file.group{odir=J(ROOT, 'test'); src = J('test','*.*'); recurse=true };
file.group{odir=J(ROOT, 'doc'); src = J('doc','*.*'); recurse=true };
file.group{odir=J(ROOT, 'examples'); src = J('examples','*.*');recurse=true };
file.group{odir = LIBDIR; src = winreg};
})
target('test', install, function()
lake.chdir('test')
for file in path.mask('*.lua') do
run_test(file)
end
lake.chdir('<')
end)
default('build')