-
Notifications
You must be signed in to change notification settings - Fork 2
/
BUILD.gn
43 lines (37 loc) · 866 Bytes
/
BUILD.gn
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
declare_args() {
cxx = "clang++"
ld = "clang++"
}
action("world") {
gen_dir = "./gen"
script = "generate_world.py"
args = [
gen_dir,
"world.cc",
"world.h",
]
outputs = [
"$root_build_dir/$gen_dir/world.cc",
"$root_build_dir/$gen_dir/world.h",
]
}
executable("hello") {
sources = [ "hello.cc" ] + get_target_outputs(":world")
include_dirs = [ "$root_build_dir/gen" ]
libs = [ "c++" ]
deps = [ ":world" ]
}
toolchain("toolchain") {
tool("cxx") {
command = "$cxx -MMD -MF {{output}}.d {{include_dirs}} -o {{output}} -c {{source}}"
depfile = "{{output}}.d"
outputs = [ "{{target_out_dir}}/{{source_name_part}}.o" ]
}
tool("link") {
command = "$ld {{inputs}} {{libs}} -o {{target_output_name}}"
outputs = [ "{{target_output_name}}" ]
}
tool("stamp") {
command = "touch {{output}}"
}
}