-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtargets.lua
More file actions
38 lines (28 loc) · 862 Bytes
/
targets.lua
File metadata and controls
38 lines (28 loc) · 862 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
local targets = { }
local default_targets = { }
function make_target (t)
if type(t) ~= 'table' then
fatal('Expected table!', nil, { t = be.util.sprint_r(t) })
end
if type(t.outputs) ~= 'table' then
fatal('At least one output or target name is required!', nil, { t = be.util.sprint_r(t) })
end
if t.rule == nil then
fatal('No rule specified for target!', nil, { t = be.util.sprint_r(t) })
end
if t.implicit_outputs then
require_ninja_version(1.7)
end
targets[#targets + 1] = t
if t.default then
append_sequence(t.outputs, default_targets, true)
end
return t
end
function add_default_targets(target_names)
append_sequence(target_names, default_targets, true)
end
function write_targets ()
write_template('targets', targets)
write_template('default_targets', default_targets)
end