OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 toolchain("gcc") { | 5 toolchain("gcc") { |
6 tool("cc") { | 6 tool("cc") { |
7 depfile = "{{output}}.d" | 7 depfile = "{{output}}.d" |
8 command = "gcc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{c
flags_c}} -c {{source}} -o {{output}}" | 8 command = |
| 9 "gcc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_
c}} -c {{source}} -o {{output}}" |
9 depsformat = "gcc" | 10 depsformat = "gcc" |
10 description = "CC {{output}}" | 11 description = "CC {{output}}" |
11 outputs = [ | 12 outputs = |
12 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", | 13 [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ] |
13 ] | |
14 } | 14 } |
15 | 15 |
16 tool("cxx") { | 16 tool("cxx") { |
17 depfile = "{{output}}.d" | 17 depfile = "{{output}}.d" |
18 command = "g++ -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{c
flags_cc}} -c {{source}} -o {{output}}" | 18 command = |
| 19 "g++ -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_
cc}} -c {{source}} -o {{output}}" |
19 depsformat = "gcc" | 20 depsformat = "gcc" |
20 description = "CXX {{output}}" | 21 description = "CXX {{output}}" |
21 outputs = [ | 22 outputs = |
22 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", | 23 [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ] |
23 ] | |
24 } | 24 } |
25 | 25 |
26 tool("alink") { | 26 tool("alink") { |
27 rspfile = "{{output}}.rsp" | 27 rspfile = "{{output}}.rsp" |
28 command = "rm -f {{output}} && ar rcs {{output}} @$rspfile" | 28 command = "rm -f {{output}} && ar rcs {{output}} @$rspfile" |
29 description = "AR {{target_output_name}}{{output_extension}}" | 29 description = "AR {{target_output_name}}{{output_extension}}" |
30 rspfile_content = "{{inputs}}" | 30 rspfile_content = "{{inputs}}" |
31 outputs = [ | 31 outputs = |
32 "{{target_out_dir}}/{{target_output_name}}{{output_extension}}" | 32 [ "{{target_out_dir}}/{{target_output_name}}{{output_extension}}" ] |
33 ] | |
34 default_output_extension = ".a" | 33 default_output_extension = ".a" |
35 output_prefix = "lib" | 34 output_prefix = "lib" |
36 } | 35 } |
37 | 36 |
38 tool("solink") { | 37 tool("solink") { |
39 soname = "{{target_output_name}}{{output_extension}}" # e.g. "libfoo.so". | 38 soname = "{{target_output_name}}{{output_extension}}" # e.g. "libfoo.so". |
40 rspfile = soname + ".rsp" | 39 rspfile = soname + ".rsp" |
41 | 40 |
42 command = "g++ -shared {{ldflags}} -o $soname -Wl,-soname=$soname @$rspfile" | 41 command = "g++ -shared {{ldflags}} -o $soname -Wl,-soname=$soname @$rspfile" |
43 rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-
archive {{libs}}" | 42 rspfile_content = |
| 43 "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive {{libs
}}" |
44 | 44 |
45 description = "SOLINK $soname" | 45 description = "SOLINK $soname" |
46 | 46 |
47 # Use this for {{output_extension}} expansions unless a target manually | 47 # Use this for {{output_extension}} expansions unless a target manually |
48 # overrides it (in which case {{output_extension}} will be what the target | 48 # overrides it (in which case {{output_extension}} will be what the target |
49 # specifies). | 49 # specifies). |
50 default_output_extension = ".so" | 50 default_output_extension = ".so" |
51 | 51 |
52 outputs = [ | 52 outputs = [ soname ] |
53 soname, | |
54 ] | |
55 link_output = soname | 53 link_output = soname |
56 depend_output = soname | 54 depend_output = soname |
57 output_prefix = "lib" | 55 output_prefix = "lib" |
58 } | 56 } |
59 | 57 |
60 tool("link") { | 58 tool("link") { |
61 outfile = "{{target_output_name}}{{output_extension}}" | 59 outfile = "{{target_output_name}}{{output_extension}}" |
62 rspfile = "$outfile.rsp" | 60 rspfile = "$outfile.rsp" |
63 command = "g++ {{ldflags}} -o $outfile -Wl,--start-group @$rspfile {{solibs}
} -Wl,--end-group {{libs}}" | 61 command = |
| 62 "g++ {{ldflags}} -o $outfile -Wl,--start-group @$rspfile {{solibs}} -Wl,
--end-group {{libs}}" |
64 description = "LINK $outfile" | 63 description = "LINK $outfile" |
65 rspfile_content = "{{inputs}}" | 64 rspfile_content = "{{inputs}}" |
66 outputs = [ outfile ] | 65 outputs = [ outfile ] |
67 } | 66 } |
68 | 67 |
69 tool("stamp") { | 68 tool("stamp") { |
70 command = "touch {{output}}" | 69 command = "touch {{output}}" |
71 description = "STAMP {{output}}" | 70 description = "STAMP {{output}}" |
72 } | 71 } |
73 | 72 |
74 tool("copy") { | 73 tool("copy") { |
75 command = "cp -af {{source}} {{output}}" | 74 command = "cp -af {{source}} {{output}}" |
76 description = "COPY {{source}} {{output}}" | 75 description = "COPY {{source}} {{output}}" |
77 } | 76 } |
78 } | 77 } |
OLD | NEW |