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 # This template defines a GCC toolchain. | 5 # This template defines a GCC toolchain. |
6 # | 6 # |
7 # It requires the following variables specifying the executables to run: | 7 # It requires the following variables specifying the executables to run: |
8 # - cc | 8 # - cc |
9 # - cxx | 9 # - cxx |
10 # - ar | 10 # - ar |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 deps = "gcc" | 65 deps = "gcc" |
66 } | 66 } |
67 tool("cxx") { | 67 tool("cxx") { |
68 # cflags_pch_cc | 68 # cflags_pch_cc |
69 command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc -c \$in -o \$out" | 69 command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc -c \$in -o \$out" |
70 description = "CXX \$out" | 70 description = "CXX \$out" |
71 depfile = "\$out.d" | 71 depfile = "\$out.d" |
72 deps = "gcc" | 72 deps = "gcc" |
73 } | 73 } |
74 tool("alink") { | 74 tool("alink") { |
75 command = "rm -f \$out && $ar rcs \$out \$in" | 75 command = "rm -f \$out && $ar rcs \$out @\$rspfile" |
76 description = "AR \$out" | 76 description = "AR \$out" |
77 rspfile = "\$out.rsp" | |
78 rspfile_content = "\$in" | |
77 } | 79 } |
78 tool("solink") { | 80 tool("solink") { |
79 command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ]; then $ld -shared \$ldfla gs -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whol e-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | c ut -f1-2 -d' '; } > \${lib}.TOC; else $ld -shared \$ldflags -o \$lib -Wl,-soname =\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive $libs_section _prefix \$libs $libs_section_postfix && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.tmp && if ! cmp -s \${lib}.tmp \ ${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC ; fi; fi" | 81 command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ]; then $ld -shared \$ldfla gs -o \$lib -Wl,-soname=\$soname @\$rspfile && { readelf -d \${lib} | grep SONAM E ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.TOC; else $ld -shared \$l dflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no- whole-archive $libs_section_prefix \$libs $libs_section_postfix && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.tmp & & if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}.TOC ; fi; fi" |
80 description = "SOLINK \$lib" | 82 description = "SOLINK \$lib" |
83 rspfile = "\$out.rsp" | |
Nico
2014/05/30 16:37:24
Note that this won't work on OS X in ninja 1.4, th
brettw
2014/05/30 17:24:39
Okay, I require a trunk Ninja build for Windows to
| |
84 rspfile_content = "-Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archiv e \$libs" | |
brettw
2014/05/30 00:49:31
This is copied from GYP. Not sure why it includes
Nico
2014/05/30 16:37:24
Doesn't matter too much I suppose; I felt putting
| |
81 #pool = "link_pool" | 85 #pool = "link_pool" |
82 restat = "1" | 86 restat = "1" |
83 } | 87 } |
84 tool("link") { | 88 tool("link") { |
85 command = "$ld \$ldflags -o \$out -Wl,--start-group \$in \$solibs -Wl,--en d-group $libs_section_prefix \$libs $libs_section_postfix" | 89 command = "$ld \$ldflags -o \$out -Wl,--start-group @\$rspfile \$solibs -W l,--end-group $libs_section_prefix \$libs $libs_section_postfix" |
86 description = "LINK \$out" | 90 description = "LINK \$out" |
91 rspfile = "\$out.rsp" | |
92 rspfile_content = "\$in" | |
87 #pool = "link_pool" | 93 #pool = "link_pool" |
88 } | 94 } |
89 tool("stamp") { | 95 tool("stamp") { |
90 command = "\${postbuilds}touch \$out" | 96 command = "\${postbuilds}touch \$out" |
91 description = "STAMP \$out" | 97 description = "STAMP \$out" |
92 } | 98 } |
93 tool("copy") { | 99 tool("copy") { |
94 command = "ln -f \$in \$out 2>/dev/null || (rm -rf \$out && cp -af \$in \$ out)" | 100 command = "ln -f \$in \$out 2>/dev/null || (rm -rf \$out && cp -af \$in \$ out)" |
95 description = "COPY \$in \$out" | 101 description = "COPY \$in \$out" |
96 } | 102 } |
97 | 103 |
98 # When invoking this toolchain not as the default one, these args will be | 104 # When invoking this toolchain not as the default one, these args will be |
99 # passed to the build. They are ignored when this is the default toolchain. | 105 # passed to the build. They are ignored when this is the default toolchain. |
100 toolchain_args() { | 106 toolchain_args() { |
101 cpu_arch = invoker.toolchain_cpu_arch | 107 cpu_arch = invoker.toolchain_cpu_arch |
102 os = invoker.toolchain_os | 108 os = invoker.toolchain_os |
103 } | 109 } |
104 } | 110 } |
105 } | 111 } |
OLD | NEW |