-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproperties.lua
More file actions
158 lines (138 loc) · 3.9 KB
/
properties.lua
File metadata and controls
158 lines (138 loc) · 3.9 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
local fs = require('be.fs')
function build_scripts.env.icon (path)
if type(path) ~= 'string' then
fatal 'Icon path must be a string!'
end
return function (configured)
if configured.icon then
fatal('Icon already specified', configured)
end
configured.icon = path
end
end
function build_scripts.env.include (spec)
return function (configured)
configured.include = append_sequence({ spec }, configured.include)
end
end
function build_scripts.env.pch (filename)
if type(filename) ~= 'string' then
fatal 'PCH filename must be a string!'
end
return function (paths, named_properties)
named_properties.pch = filename
return paths
end
end
function build_scripts.env.pch_src (path)
if type(path) ~= 'string' then
fatal 'PCH source path must be a string!'
end
return function (paths, named_properties, search_path, configured_project, globtype)
named_properties.pch_src = expand_path(path, search_path)
local new_paths = { }
local n = 0
for i = 1, #paths do
local path = paths[i]
if not fs.equivalent(path, named_properties.pch_src) then
n = n + 1
new_paths[n] = path
end
end
return new_paths
end
end
function build_scripts.env.src (pathspec)
return function (configured)
configured.src = append_sequence({ pathspec }, configured.src)
end
end
function build_scripts.env.limp_src(pathspec)
return function (configured)
configured.limp_src = append_sequence({ pathspec }, configured.limp_src)
end
end
function build_scripts.env.link (spec)
return function (configured)
configured.link = append_sequence(spec, configured.link, true)
end
end
function build_scripts.env.link_project (spec)
return function (configured)
configured.link_project = append_sequence(spec, configured.link_project, true)
end
end
function build_scripts.env.define (spec)
return function (configured)
if type(spec) == 'string' then
configured.define[spec] = false
else
for k, v in pairs(spec) do
if type(k) == 'number' then
configured.define[v] = false
else
configured.define[k] = v
end
end
end
end
end
function build_scripts.env.export_define (spec)
return function (configured)
if type(spec) == 'string' then
configured.export_define[spec] = false
else
for k, v in pairs(spec) do
if type(k) == 'number' then
configured.export_define[v] = false
else
configured.export_define[k] = v
end
end
end
end
end
function build_scripts.env.test_type (test_type)
if type(path) ~= 'string' then
fatal 'Icon path must be a string!'
end
return function (configured)
if configured.test_type then
fatal('Test type already specified', configured)
end
configured.test_type = test_type
end
end
function build_scripts.env.gui (configured)
configured.gui = true
end
function build_scripts.env.console (configured)
configured.console = true
end
function build_scripts.env.rtti (configured)
configured.rtti = true
end
function build_scripts.env.force_c (configured)
configured.force_c = true
end
function build_scripts.env.force_cxx (configured)
configured.force_cxx = true
end
function build_scripts.env.require_admin (configured)
configured.require_admin = true
end
function build_scripts.env.disabled (configured)
configured.disabled = true
end
function build_scripts.env.enabled (configured)
configured.disabled = false
end
function build_scripts.env.path (path)
return function (configured)
if configured.configured_group then
configured.path = expand_path(path, { configured.configured_group.path, root_dir })
else
configured.path = path
end
end
end