-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path_preload.lua
More file actions
130 lines (104 loc) · 2.66 KB
/
_preload.lua
File metadata and controls
130 lines (104 loc) · 2.66 KB
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
121
122
123
124
125
126
127
128
129
130
--
-- Name: winrt/_preload.lua
-- Purpose: Define the WinRT APIs
-- Author: Samuel Surtees
-- Copyright: (c) 2015 Samuel Surtees and the Premake project
--
local p = premake
local api = p.api
--
-- Register the WinRT extension
--
p.WINSTORE80 = "windowsstore8.0"
p.WINSTORE81 = "windowsstore8.1"
p.WINPHONE80 = "windowsphone8.0"
p.WINPHONE81 = "windowsphone8.1"
p.WINUNIVERSAL = "windowsuniversal"
p.ARM = "arm"
api.addAllowed("system", { p.WINSTORE80, p.WINSTORE81, p.WINPHONE80, p.WINPHONE81, p.WINUNIVERSAL })
api.addAllowed("architecture", { p.ARM })
--
-- Register the AppxManifest action
--
newaction {
trigger = "appxmanifest",
shortname = "Package.appxmanifest",
description = "Generate Package.appxmanifest files",
valid_kinds = { "WindowedApp" },
onProject = function(prj)
p.modules.winrt.generateAppxManifest(prj)
end,
onCleanProject = function(prj)
p.clean.directory(prj, prj.name)
end,
}
--
-- Register WinRT properties
--
api.register {
name = "defaultlanguage",
scope = "project",
kind = "string",
}
api.register {
name = "consumewinrtextension",
scope = "config",
kind = "string",
allowed = {
"true",
"false",
},
}
api.register {
name = "deploy",
scope = "config",
kind = "string",
allowed = {
"true",
"false",
},
}
api.register {
name = "generatewinmd",
scope = "config",
kind = "string",
allowed = {
"true",
"false",
}
}
api.register {
name = "certificatefile",
scope = "project",
kind = "string",
}
api.register {
name = "certificatethumbprint",
scope = "project",
kind = "string",
}
--
-- Set global environment for the default WinRT platforms
--
filter { "system:windowsstore8.0 or windowsstore8.1 or windowsphone8.0 or windowsphone8.1 or windowsuniversal", "kind:ConsoleApp or WindowedApp" }
targetextension ".exe"
filter { "system:windowsstore8.0 or windowsstore8.1 or windowsphone8.0 or windowsphone8.1 or windowsuniversal", "kind:SharedLib" }
targetprefix ""
targetextension ".dll"
implibextension ".lib"
filter { "system:windowsstore8.0 or windowsstore8.1 or windowsphone8.0 or windowsphone8.1 or windowsuniversal", "kind:StaticLib" }
targetprefix ""
targetextension ".lib"
filter { "system:windowsphone8.0" }
toolset "v110_wp80"
filter { "system:windowsphone8.1" }
toolset "v120_wp81"
filter { "system:windowsstore8.1" }
toolset "v120"
filter {}
--
-- Decide when the full module should be loaded.
--
return function(cfg)
return _ACTION == "appxmanifest" or cfg.system == p.WINSTORE80 or cfg.system == p.WINSTORE81 or cfg.system == p.WINPHONE80 or cfg.system == p.WINPHONE81 or cfg.system == p.WINUNIVERSAL
end