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 # TODO(brettw) Use "gcc_toolchain.gni" like the Linux toolchains. This requires | 5 # TODO(brettw) Use "gcc_toolchain.gni" like the Linux toolchains. This requires |
6 # some enhancements since the commands on Mac are slightly different than on | 6 # some enhancements since the commands on Mac are slightly different than on |
7 # Linux. | 7 # Linux. |
8 | 8 |
9 import("../goma.gni") | 9 import("../goma.gni") |
10 import("//build/config/ios/ios_sdk.gni") | 10 import("//build/config/ios/ios_sdk.gni") |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 cc = invoker.cc | 43 cc = invoker.cc |
44 cxx = invoker.cxx | 44 cxx = invoker.cxx |
45 ld = invoker.ld | 45 ld = invoker.ld |
46 | 46 |
47 # Make these apply to all tools below. | 47 # Make these apply to all tools below. |
48 lib_switch = "-l" | 48 lib_switch = "-l" |
49 lib_dir_switch = "-L" | 49 lib_dir_switch = "-L" |
50 | 50 |
51 tool("cc") { | 51 tool("cc") { |
52 depfile = "{{output}}.d" | 52 depfile = "{{output}}.d" |
53 precompiled_header_type = "gcc" | 53 |
| 54 # TODO(andybons): enable this when GCC PCH support in the binary has been |
| 55 # rolled. |
| 56 #precompiled_header_type = "gcc" |
54 command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {
{cflags_c}} -c {{source}} -o {{output}}" | 57 command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {
{cflags_c}} -c {{source}} -o {{output}}" |
55 depsformat = "gcc" | 58 depsformat = "gcc" |
56 description = "CC {{output}}" | 59 description = "CC {{output}}" |
57 outputs = [ | 60 outputs = [ |
58 "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", | 61 "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", |
59 ] | 62 ] |
60 } | 63 } |
61 | 64 |
62 tool("cxx") { | 65 tool("cxx") { |
63 depfile = "{{output}}.d" | 66 depfile = "{{output}}.d" |
64 precompiled_header_type = "gcc" | 67 |
| 68 # TODO(andybons): enable this when GCC PCH support in the binary has been |
| 69 # rolled. |
| 70 #precompiled_header_type = "gcc" |
65 command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}}
{{cflags_cc}} -c {{source}} -o {{output}}" | 71 command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}}
{{cflags_cc}} -c {{source}} -o {{output}}" |
66 depsformat = "gcc" | 72 depsformat = "gcc" |
67 description = "CXX {{output}}" | 73 description = "CXX {{output}}" |
68 outputs = [ | 74 outputs = [ |
69 "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", | 75 "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", |
70 ] | 76 ] |
71 } | 77 } |
72 | 78 |
73 tool("asm") { | 79 tool("asm") { |
74 # For GCC we can just use the C compiler to compile assembly. | 80 # For GCC we can just use the C compiler to compile assembly. |
75 depfile = "{{output}}.d" | 81 depfile = "{{output}}.d" |
76 command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{asmflags}}
-c {{source}} -o {{output}}" | 82 command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {
{cflags_c}} -c {{source}} -o {{output}}" |
77 depsformat = "gcc" | 83 depsformat = "gcc" |
78 description = "ASM {{output}}" | 84 description = "ASM {{output}}" |
79 outputs = [ | 85 outputs = [ |
80 "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", | 86 "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", |
81 ] | 87 ] |
82 } | 88 } |
83 | 89 |
84 tool("objc") { | 90 tool("objc") { |
85 depfile = "{{output}}.d" | 91 depfile = "{{output}}.d" |
86 command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}}
{{cflags_objc}} -c {{source}} -o {{output}}" | 92 command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}}
{{cflags_objc}} -c {{source}} -o {{output}}" |
87 precompiled_header_type = "gcc" | 93 |
| 94 # TODO(andybons): enable this when GCC PCH support in the binary has been |
| 95 # rolled. |
| 96 #precompiled_header_type = "gcc" |
88 command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}}
{{cflags_c}} {{cflags_objc}} -c {{source}} -o {{output}}" | 97 command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}}
{{cflags_c}} {{cflags_objc}} -c {{source}} -o {{output}}" |
89 depsformat = "gcc" | 98 depsformat = "gcc" |
90 description = "OBJC {{output}}" | 99 description = "OBJC {{output}}" |
91 outputs = [ | 100 outputs = [ |
92 "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", | 101 "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", |
93 ] | 102 ] |
94 } | 103 } |
95 | 104 |
96 tool("objcxx") { | 105 tool("objcxx") { |
97 depfile = "{{output}}.d" | 106 depfile = "{{output}}.d" |
98 command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}}
{{cflags_objcc}} -c {{source}} -o {{output}}" | 107 command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}}
{{cflags_objcc}} -c {{source}} -o {{output}}" |
99 precompiled_header_type = "gcc" | 108 |
| 109 # TODO(andybons): enable this when GCC PCH support in the binary has been |
| 110 # rolled. |
| 111 #precompiled_header_type = "gcc" |
100 depsformat = "gcc" | 112 depsformat = "gcc" |
101 description = "OBJCXX {{output}}" | 113 description = "OBJCXX {{output}}" |
102 outputs = [ | 114 outputs = [ |
103 "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", | 115 "{{target_out_dir}}/{{target_output_name}}/{{source_name_part}}.o", |
104 ] | 116 ] |
105 } | 117 } |
106 | 118 |
107 tool("alink") { | 119 tool("alink") { |
108 command = "rm -f {{output}} && ./gyp-mac-tool filter-libtool libtool -stat
ic -o {{output}} {{inputs}}" | 120 command = "rm -f {{output}} && ./gyp-mac-tool filter-libtool libtool -stat
ic -o {{output}} {{inputs}}" |
109 description = "LIBTOOL-STATIC {{output}}" | 121 description = "LIBTOOL-STATIC {{output}}" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 } | 263 } |
252 | 264 |
253 mac_toolchain("x64") { | 265 mac_toolchain("x64") { |
254 toolchain_cpu = "x64" | 266 toolchain_cpu = "x64" |
255 toolchain_os = "mac" | 267 toolchain_os = "mac" |
256 cc = "${goma_prefix}/gcc" | 268 cc = "${goma_prefix}/gcc" |
257 cxx = "${goma_prefix}/g++" | 269 cxx = "${goma_prefix}/g++" |
258 ld = cxx | 270 ld = cxx |
259 is_clang = false | 271 is_clang = false |
260 } | 272 } |
OLD | NEW |