-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.gn
executable file
·127 lines (102 loc) · 2.73 KB
/
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
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
print(">> 02 - BUILD.gn")
#** librarys **
LIBXXX_SO = [ "libhelloworld.so" ]
# https://gn.googlesource.com/gn/+/main/docs/reference.md#func_shared_library
shared_library("helloworld_shared") {
sources = [
"helloworld_dbg.c",
"helloworld_dbg.h",
]
output_name = "helloworld"
#print(">> " + output_name)
#output_dir = "$root_out_dir"
# -DPJ_LANKA520V2
defines = [ "PJ_LANKA520V2" ]
if ( is_debug == true )
{
print(">> shared_library / helloworld_shared - $configs")
}
}
LIBXXX_A = [ "libhelloworld_static.a" ]
# https://gn.googlesource.com/gn/+/main/docs/reference.md#func_static_library
static_library("helloworld_static") {
sources = [
"helloworld_dbg.c",
"helloworld_dbg.h",
]
output_name = "helloworld_static"
#output_dir = "$root_out_dir/libs"
defines = [ "PJ_LANKA520V3" ]
if ( is_debug == true )
{
print(">> static_library / helloworld_static - $configs")
}
}
print(">> (LIBXXX_SO: $LIBXXX_SO)")
print(">> (LIBXXX_A: $LIBXXX_A)")
#** Target (CLEAN_BINS) **
print(">> (CLEAN_BINS: $CLEAN_BINS)")
#** Target (DUMMY_BINS) **
DUMMY_BINS += [ "helloworld" ]
# https://gn.googlesource.com/gn/+/main/docs/reference.md#func_executable
executable("helloworld-123") {
sources = [ "helloworld-123.c" ]
deps = [
":helloworld_shared",
":helloworld_static",
]
if ( is_debug == true )
{
print(">> executable / helloworld-123 - $configs")
}
}
DUMMY_BINS += [ "pipe2" ]
executable("pipe2")
{
sources = [ "pipe2.c" ]
if ( is_debug == true )
{
print(">> executable / pipe2 - $configs")
}
}
DUMMY_BINS += [ "helloworld" ]
executable("helloworld")
{
sources = [ "helloworld.c" ]
if ( is_debug == true )
{
print(">> executable / helloworld - $configs")
}
}
print(">> (DUMMY_BINS: $DUMMY_BINS)")
#** Target (CONFS) **
#CONFS= []
print(">> (CONFS: $CONFS)")
#** HEADER_FILES **
HEADER_FILES += [ "helloworld_dbg.h" ]
print(">> (HEADER_FILES: $HEADER_FILES)")
# https://gn.googlesource.com/gn/+/main/docs/reference.md#func_copy
# .PHONY: install
# use |$target_out_dir| or |$target_gen_dir| to reference the output
copy("install_inc") {
sources = HEADER_FILES
outputs = [ "$target_out_dir/../include/{{source_file_part}}" ]
}
# https://gn.googlesource.com/gn/+/main/docs/reference.md#func_group
# .PHONY: others
# ninja -v -C build_xxx others
group("others") {
deps = [
# This will expand to the name "//tutorial:tutorial" which is the full name
# of our new target. Run "gn help labels" for more.
"//cppTest"
,":install_inc"
]
if ( is_debug == true )
{
print(">> (target_gen_dir: $target_gen_dir)")
print(">> (target_out_dir: $target_out_dir)")
print(">> (root_build_dir: $root_build_dir)")
print(">> (root_out_dir: $root_out_dir)")
}
}