OLD | NEW |
1 # Copyright 2016 Google Inc. | 1 # Copyright 2016 Google Inc. |
2 # | 2 # |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 declare_args() { | 6 declare_args() { |
7 ar = "ar" | 7 ar = "ar" |
8 cc = "cc" | 8 cc = "cc" |
9 cxx = "c++" | 9 cxx = "c++" |
| 10 |
| 11 extra_cflags = "" |
| 12 extra_cflags_c = "" |
| 13 extra_cflags_cc = "" |
10 } | 14 } |
11 | 15 |
12 config("no_rtti") { | 16 config("no_rtti") { |
13 cflags_cc = [ "-fno-rtti" ] | 17 cflags_cc = [ "-fno-rtti" ] |
14 } | 18 } |
15 | 19 |
16 config("default") { | 20 config("default") { |
17 cflags = [ | 21 cflags = [ |
18 "-g", | 22 "-g", |
19 "-fstrict-aliasing", | 23 "-fstrict-aliasing", |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 pool("link_pool") { | 61 pool("link_pool") { |
58 depth = 0 #unlimited | 62 depth = 0 #unlimited |
59 } | 63 } |
60 | 64 |
61 toolchain("gcc_like") { | 65 toolchain("gcc_like") { |
62 lib_switch = "-l" | 66 lib_switch = "-l" |
63 lib_dir_switch = "-L" | 67 lib_dir_switch = "-L" |
64 | 68 |
65 tool("cc") { | 69 tool("cc") { |
66 depfile = "{{output}}.d" | 70 depfile = "{{output}}.d" |
67 command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{c
flags_c}} -c {{source}} -o {{output}}" | 71 command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{c
flags_c}} $extra_cflags $extra_cflags_c -c {{source}} -o {{output}}" |
68 depsformat = "gcc" | 72 depsformat = "gcc" |
69 outputs = [ | 73 outputs = [ |
70 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", | 74 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", |
71 ] | 75 ] |
72 description = "$cc ... -o {{output}}" | 76 description = "$cc ... -o {{output}}" |
73 } | 77 } |
74 | 78 |
75 tool("cxx") { | 79 tool("cxx") { |
76 depfile = "{{output}}.d" | 80 depfile = "{{output}}.d" |
77 command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{
cflags_cc}} -c {{source}} -o {{output}}" | 81 command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{
cflags_cc}} $extra_cflags $extra_cflags_cc -c {{source}} -o {{output}}" |
78 depsformat = "gcc" | 82 depsformat = "gcc" |
79 outputs = [ | 83 outputs = [ |
80 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", | 84 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", |
81 ] | 85 ] |
82 description = "$cxx ... -o {{output}}" | 86 description = "$cxx ... -o {{output}}" |
83 } | 87 } |
84 | 88 |
85 tool("asm") { | 89 tool("asm") { |
86 depfile = "{{output}}.d" | 90 depfile = "{{output}}.d" |
87 command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{asmflags}} -
c {{source}} -o {{output}}" | 91 command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{asmflags}} -
c {{source}} -o {{output}}" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 } | 134 } |
131 | 135 |
132 tool("stamp") { | 136 tool("stamp") { |
133 command = "touch {{output}}" | 137 command = "touch {{output}}" |
134 } | 138 } |
135 | 139 |
136 tool("copy") { | 140 tool("copy") { |
137 command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} &&
cp -af {{source}} {{output}})" | 141 command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} &&
cp -af {{source}} {{output}})" |
138 } | 142 } |
139 } | 143 } |
OLD | NEW |