forked from litehtml/litehtml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
premake5.lua
120 lines (113 loc) · 2.79 KB
/
premake5.lua
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
if os.ishost "windows" then
-- Windows
newaction
{
trigger = "build",
description = "Build the litehtml library",
execute = function ()
-- os.rmdir "_build32"
-- os.execute "mkdir _build32 & pushd _build32 \z
-- && cmake -G \"Visual Studio 15 2017\" ..\\ \z
-- && popd \z
-- && cmake --build _build32 --config Debug"
-- os.rmdir "_build64"
-- os.execute "mkdir _build & pushd _build \z
-- && cmake -G \"Visual Studio 15 2017 Win64\" ..\\ \z
-- && popd \z
-- && cmake --build _build --config Debug"
os.rmdir "_build"
os.execute "mkdir _build & pushd _build \z
&& cmake ..\\ \z
&& popd \z
&& cmake --build _build --config Debug"
end
}
newaction
{
trigger = "test",
description = "Build and run all unit tests",
execute = function ()
os.execute "premake5 build"
os.execute "pushd _build \z
&& ctest -C Debug \z
&& popd"
end
}
else
-- MacOSX and Linux.
newaction
{
trigger = "build",
description = "Build the litehtml library",
execute = function ()
os.rmdir "_build"
os.execute "mkdir _build && cd _build \z
&& cmake ../ \z
&& cd .. \z
&& cmake --build _build --config Debug"
end
}
newaction
{
trigger = "test",
description = "Build and run all unit tests",
execute = function ()
os.execute "premake5 build"
os.execute "cd _build \z
&& ctest -C Debug \z
&& cd .."
end
}
newaction
{
trigger = "loc",
description = "Count lines of code",
execute = function ()
os.execute "wc -l *.cs"
end
}
end
newaction
{
trigger = "clean",
description = "Clean all build files and output",
execute = function ()
files_to_delete =
{
"*.make",
"*.zip",
"*.tar.gz",
"*.db",
"*.opendb"
}
directories_to_delete =
{
"_build",
"_build32",
"_build64",
"Testing",
"obj",
"ipch",
"bin",
"nupkgs",
".vs",
".vscode",
"Debug",
"Release",
"release"
}
for i,v in ipairs( directories_to_delete ) do
os.rmdir( v )
end
if not os.ishost "windows" then
os.execute "find . -name .DS_Store -delete"
for i,v in ipairs( files_to_delete ) do
os.execute( "rm -f " .. v )
end
else
for i,v in ipairs( files_to_delete ) do
os.execute( "del /F /Q " .. v )
end
end
end
}