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 | 10 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 110 } |
111 | 111 |
112 config("executable") { | 112 config("executable") { |
113 if (is_mac) { | 113 if (is_mac) { |
114 ldflags = [ "-Wl,-rpath,@loader_path/." ] | 114 ldflags = [ "-Wl,-rpath,@loader_path/." ] |
115 } else if (is_linux) { | 115 } else if (is_linux) { |
116 ldflags = [ "-Wl,-rpath,\$ORIGIN" ] | 116 ldflags = [ "-Wl,-rpath,\$ORIGIN" ] |
117 } | 117 } |
118 } | 118 } |
119 | 119 |
120 pool("link_pool") { | |
121 depth = 0 #unlimited | |
122 } | |
123 | |
124 toolchain("gcc_like") { | 120 toolchain("gcc_like") { |
125 lib_switch = "-l" | 121 lib_switch = "-l" |
126 lib_dir_switch = "-L" | 122 lib_dir_switch = "-L" |
127 | 123 |
128 tool("cc") { | 124 tool("cc") { |
129 depfile = "{{output}}.d" | 125 depfile = "{{output}}.d" |
130 command = "$compiler_prefix $cc -MMD -MF $depfile {{defines}} {{include_dirs
}} {{cflags}} {{cflags_c}} $extra_cflags $extra_cflags_c -c {{source}} -o {{outp
ut}}" | 126 command = "$compiler_prefix $cc -MMD -MF $depfile {{defines}} {{include_dirs
}} {{cflags}} {{cflags_c}} $extra_cflags $extra_cflags_c -c {{source}} -o {{outp
ut}}" |
131 depsformat = "gcc" | 127 depsformat = "gcc" |
132 outputs = [ | 128 outputs = [ |
133 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", | 129 "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 rpath = "-Wl,-install_name,@rpath/$soname" | 171 rpath = "-Wl,-install_name,@rpath/$soname" |
176 } | 172 } |
177 | 173 |
178 command = "$compiler_prefix $cxx -shared {{ldflags}} {{inputs}} {{solibs}} {
{libs}} $rpath -o {{output}}" | 174 command = "$compiler_prefix $cxx -shared {{ldflags}} {{inputs}} {{solibs}} {
{libs}} $rpath -o {{output}}" |
179 outputs = [ | 175 outputs = [ |
180 "{{root_out_dir}}/$soname", | 176 "{{root_out_dir}}/$soname", |
181 ] | 177 ] |
182 output_prefix = "lib" | 178 output_prefix = "lib" |
183 default_output_extension = ".so" | 179 default_output_extension = ".so" |
184 description = "$compiler_prefix $cxx -shared ... -o {{output}}" | 180 description = "$compiler_prefix $cxx -shared ... -o {{output}}" |
185 pool = ":link_pool" | |
186 } | 181 } |
187 | 182 |
188 tool("link") { | 183 tool("link") { |
189 command = "$compiler_prefix $cxx {{ldflags}} {{inputs}} {{solibs}} {{libs}}
-o {{output}}" | 184 command = "$compiler_prefix $cxx {{ldflags}} {{inputs}} {{solibs}} {{libs}}
-o {{output}}" |
190 outputs = [ | 185 outputs = [ |
191 "{{root_out_dir}}/{{target_output_name}}{{output_extension}}", | 186 "{{root_out_dir}}/{{target_output_name}}{{output_extension}}", |
192 ] | 187 ] |
193 description = "$compiler_prefix $cxx ... -o {{output}}" | 188 description = "$compiler_prefix $cxx ... -o {{output}}" |
194 pool = ":link_pool" | |
195 } | 189 } |
196 | 190 |
197 tool("stamp") { | 191 tool("stamp") { |
198 command = "touch {{output}}" | 192 command = "touch {{output}}" |
199 } | 193 } |
200 | 194 |
201 tool("copy") { | 195 tool("copy") { |
202 command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} &&
cp -af {{source}} {{output}})" | 196 command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} &&
cp -af {{source}} {{output}})" |
203 } | 197 } |
204 } | 198 } |
OLD | NEW |