-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdurango.lua
72 lines (52 loc) · 1.29 KB
/
durango.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
--
-- Xbox One XDK support for Visual Studio backend.
-- Copyright Blizzard Entertainment, Inc
--
--
-- Non-overrides
--
local p = premake
local vstudio = p.vstudio
local vc2010 = p.vstudio.vc2010
p.DURANGO = "durango"
if vstudio.vs2010_architectures ~= nil then
vstudio.vs2010_architectures.durango = "Durango"
p.api.addAllowed("system", p.DURANGO)
os.systemTags[p.DURANGO] = { "durango", "xboxone_xdk", "xboxone", "xdk", "xbox", "console" }
local osoption = p.option.get("os")
if osoption ~= nil then
table.insert(osoption.allowed, { p.DURANGO, "Xbox One (XDK)" })
end
end
filter { "system:Durango" }
architecture "x86_64"
filter { "system:Durango", "kind:ConsoleApp or WindowedApp" }
targetextension ".exe"
filter { "system:Durango", "kind:StaticLib" }
targetprefix ""
targetextension ".lib"
filter {}
--
-- Properties
--
p.api.register {
name = "compileaswinrt",
scope = "config",
kind = "boolean"
}
--
-- Methods.
--
local function winrt(cfg)
vc2010.element("CompileAsWinRT", nil, iif(cfg.compileaswinrt, "true", "false"))
end
--
-- Overrides
--
p.override(vc2010.elements, "clCompile", function(base, cfg)
local calls = base(cfg)
if cfg.system == p.DURANGO and (cfg.kind == p.CONSOLEAPP or cfg.kind == p.WINDOWEDAPP) then
table.insert(calls, winrt)
end
return calls
end)