forked from jie-meng/Util
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtools.lua
More file actions
41 lines (32 loc) · 835 Bytes
/
tools.lua
File metadata and controls
41 lines (32 loc) · 835 Bytes
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
local Tools = {}
function Tools.isPlatformWindows()
return util.strContains(util.platformInfo(), "win", false)
end
function Tools.getAppName()
if Tools.isPlatformWindows() then
return "luaexec.exe"
else
return "./luaexec"
end
end
function Tools.make()
local application = './luaexec'
local cmake_cmd = 'cmake .'
local make_cmd = 'make'
if Tools.isPlatformWindows() then
application = 'luaexec.exe'
cmake_cmd = 'cmake -G "MinGW Makefiles'
make_cmd = 'mingw32-make'
end
print('Make started ...\n')
util.pathRemove(application)
os.execute(cmake_cmd)
os.execute(make_cmd)
if not util.isPathFile(application) then
print('Make fail.\n')
return false
end
print('Make success.\n')
return true
end
return Tools