| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 import("//build/config/nacl/config.gni") | 5 import("//build/config/nacl/config.gni") |
| 6 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
| 7 import("//build/toolchain/ccache.gni") | 7 import("//build/toolchain/ccache.gni") |
| 8 import("//build/toolchain/goma.gni") | 8 import("//build/toolchain/goma.gni") |
| 9 import("//build/toolchain/toolchain.gni") | 9 import("//build/toolchain/toolchain.gni") |
| 10 | 10 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 if (defined(invoker.solink_libs_section_postfix)) { | 167 if (defined(invoker.solink_libs_section_postfix)) { |
| 168 solink_libs_section_postfix = invoker.solink_libs_section_postfix | 168 solink_libs_section_postfix = invoker.solink_libs_section_postfix |
| 169 } else { | 169 } else { |
| 170 solink_libs_section_postfix = "" | 170 solink_libs_section_postfix = "" |
| 171 } | 171 } |
| 172 | 172 |
| 173 # These library switches can apply to all tools below. | 173 # These library switches can apply to all tools below. |
| 174 lib_switch = "-l" | 174 lib_switch = "-l" |
| 175 lib_dir_switch = "-L" | 175 lib_dir_switch = "-L" |
| 176 | 176 |
| 177 # Object files go in this directory. |
| 178 object_subdir = "{{target_out_dir}}/{{label_name}}" |
| 179 |
| 177 tool("cc") { | 180 tool("cc") { |
| 178 depfile = "{{output}}.d" | 181 depfile = "{{output}}.d" |
| 179 command = "$cc -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_di
rs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}" | 182 command = "$cc -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_di
rs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}" |
| 180 depsformat = "gcc" | 183 depsformat = "gcc" |
| 181 description = "CC {{output}}" | 184 description = "CC {{output}}" |
| 182 outputs = [ | 185 outputs = [ |
| 183 "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", | 186 "$object_subdir/{{source_name_part}}.o", |
| 184 ] | 187 ] |
| 185 } | 188 } |
| 186 | 189 |
| 187 tool("cxx") { | 190 tool("cxx") { |
| 188 depfile = "{{output}}.d" | 191 depfile = "{{output}}.d" |
| 189 command = "$cxx -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_d
irs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}" | 192 command = "$cxx -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_d
irs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}" |
| 190 depsformat = "gcc" | 193 depsformat = "gcc" |
| 191 description = "CXX {{output}}" | 194 description = "CXX {{output}}" |
| 192 outputs = [ | 195 outputs = [ |
| 193 "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", | 196 "$object_subdir/{{source_name_part}}.o", |
| 194 ] | 197 ] |
| 195 } | 198 } |
| 196 | 199 |
| 197 tool("asm") { | 200 tool("asm") { |
| 198 # For GCC we can just use the C compiler to compile assembly. | 201 # For GCC we can just use the C compiler to compile assembly. |
| 199 depfile = "{{output}}.d" | 202 depfile = "{{output}}.d" |
| 200 command = "$cc -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_di
rs}} {{asmflags}} -c {{source}} -o {{output}}" | 203 command = "$cc -MMD -MF $depfile ${rebuild_string}{{defines}} {{include_di
rs}} {{asmflags}} -c {{source}} -o {{output}}" |
| 201 depsformat = "gcc" | 204 depsformat = "gcc" |
| 202 description = "ASM {{output}}" | 205 description = "ASM {{output}}" |
| 203 outputs = [ | 206 outputs = [ |
| 204 "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", | 207 "$object_subdir/{{source_name_part}}.o", |
| 205 ] | 208 ] |
| 206 } | 209 } |
| 207 | 210 |
| 208 tool("alink") { | 211 tool("alink") { |
| 209 rspfile = "{{output}}.rsp" | 212 rspfile = "{{output}}.rsp" |
| 210 arflags = "" | 213 arflags = "" |
| 211 if (is_cfi && invoker.toolchain_os != "nacl") { | 214 if (is_cfi && invoker.toolchain_os != "nacl") { |
| 212 gold_plugin_path = rebase_path( | 215 gold_plugin_path = rebase_path( |
| 213 "//third_party/llvm-build/Release+Asserts/lib/LLVMgold.so", | 216 "//third_party/llvm-build/Release+Asserts/lib/LLVMgold.so", |
| 214 root_build_dir) | 217 root_build_dir) |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 nm = "${toolprefix}nm" | 446 nm = "${toolprefix}nm" |
| 444 | 447 |
| 445 forward_variables_from(invoker, | 448 forward_variables_from(invoker, |
| 446 [ | 449 [ |
| 447 "toolchain_cpu", | 450 "toolchain_cpu", |
| 448 "toolchain_os", | 451 "toolchain_os", |
| 449 "use_gold", | 452 "use_gold", |
| 450 ]) | 453 ]) |
| 451 } | 454 } |
| 452 } | 455 } |
| OLD | NEW |