-
Notifications
You must be signed in to change notification settings - Fork 78
/
VC-LTL5.lua
44 lines (39 loc) · 1.7 KB
/
VC-LTL5.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
target("VC-LTL-5")
set_kind("phony")
before_build("windows", function (target)
local function find_in_file()
for _, dir in ipairs(os.dirs("$(projectdir)/*")) do
name = dir:match(".*\\(.*)")
if name:find("VC%-LTL") then
return dir .. [[\build\native\]]
end
end
end
local function find_in_reg()
return vformat("$(reg HKEY_CURRENT_USER\\Code\\VC-LTL;Root)")
end
local VC_LTL_Root = find_in_file() or find_in_reg()
if #VC_LTL_Root==0 then
return
end
local WindowsTargetPlatformMinVersion = "6.0.6000.0"
cprint("${color.warning}VC-LTL Path : %s", VC_LTL_Root)
cprint("${color.warning}WindowsTargetPlatformMinVersion : %s", WindowsTargetPlatformMinVersion)
import("core.tool.toolchain")
local msvc = toolchain.load("msvc")
local runenvs = msvc:runenvs()
local includepath = VC_LTL_Root .. [[TargetPlatform\header;]] .. VC_LTL_Root .. [[TargetPlatform\]] .. WindowsTargetPlatformMinVersion..[[\header;]]
runenvs.INCLUDE = includepath .. runenvs.INCLUDE
local arch = target:arch()
local archpath = "Win32"
if arch=="x86" then
archpath = "Win32"
elseif arch=="x64" then
archpath = "x64"
end
cprint("${color.warning}Platform : %s", archpath)
local libpath = VC_LTL_Root .. [[TargetPlatform\]] .. WindowsTargetPlatformMinVersion..[[\lib\]] .. archpath .. ";"
runenvs.LIB = libpath .. runenvs.LIB
-- print(runenvs.INCLUDE)
-- print(runenvs.LIB)
end)