| 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 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 ld = invoker.ld | 52 ld = invoker.ld |
| 53 | 53 |
| 54 # Make these apply to all tools below. | 54 # Make these apply to all tools below. |
| 55 lib_prefix = "-l" | 55 lib_prefix = "-l" |
| 56 lib_dir_prefix="-L" | 56 lib_dir_prefix="-L" |
| 57 | 57 |
| 58 tool("cc") { | 58 tool("cc") { |
| 59 command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c \
$cflags_pch_c -c \$in -o \$out" | 59 command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c \
$cflags_pch_c -c \$in -o \$out" |
| 60 description = "CC \$out" | 60 description = "CC \$out" |
| 61 depfile = "\$out.d" | 61 depfile = "\$out.d" |
| 62 deps = "gcc" | 62 depsformat = "gcc" |
| 63 } | 63 } |
| 64 tool("cxx") { | 64 tool("cxx") { |
| 65 command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc
\$cflags_pch_cc -c \$in -o \$out" | 65 command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc
\$cflags_pch_cc -c \$in -o \$out" |
| 66 description = "CXX \$out" | 66 description = "CXX \$out" |
| 67 depfile = "\$out.d" | 67 depfile = "\$out.d" |
| 68 deps = "gcc" | 68 depsformat = "gcc" |
| 69 } | 69 } |
| 70 tool("objc") { | 70 tool("objc") { |
| 71 command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c \
$cflags_objc \$cflags_pch_objc -c \$in -o \$out" | 71 command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c \
$cflags_objc \$cflags_pch_objc -c \$in -o \$out" |
| 72 description = "OBJC \$out" | 72 description = "OBJC \$out" |
| 73 depfile = "\$out.d" | 73 depfile = "\$out.d" |
| 74 deps = "gcc" | 74 depsformat = "gcc" |
| 75 } | 75 } |
| 76 tool("objcxx") { | 76 tool("objcxx") { |
| 77 command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc
\$cflags_objcc \$cflags_pch_objcc -c \$in -o \$out" | 77 command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc
\$cflags_objcc \$cflags_pch_objcc -c \$in -o \$out" |
| 78 description = "OBJCXX \$out" | 78 description = "OBJCXX \$out" |
| 79 depfile = "\$out.d" | 79 depfile = "\$out.d" |
| 80 deps = "gcc" | 80 depsformat = "gcc" |
| 81 } | 81 } |
| 82 tool("alink") { | 82 tool("alink") { |
| 83 command = "rm -f \$out && ./gyp-mac-tool filter-libtool libtool \$libtool_
flags -static -o \$out \$in \$postbuilds" | 83 command = "rm -f \$out && ./gyp-mac-tool filter-libtool libtool \$libtool_
flags -static -o \$out \$in \$postbuilds" |
| 84 description = "LIBTOOL-STATIC \$out" | 84 description = "LIBTOOL-STATIC \$out" |
| 85 } | 85 } |
| 86 tool("solink") { | 86 tool("solink") { |
| 87 command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ] || otool -l \$lib | grep
-q LC_REEXPORT_DYLIB ; then $ld -shared \$ldflags -o \$lib -Wl,-filelist,\$rspfi
le \$solibs \$libs \$postbuilds && { otool -l \$lib | grep LC_ID_DYLIB -A 5; nm
-gP \$lib | cut -f1-2 -d' ' | grep -v U\$\$; true; } > \${lib}.TOC; else $ld -sh
ared \$ldflags -o \$lib \$in \$solibs \$libs \$postbuilds && { otool -l \$lib |
grep LC_ID_DYLIB -A 5; nm -gP \$lib | cut -f1-2 -d' ' | grep -v U\$\$; true; } >
\${lib}.tmp && if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}
.TOC ; fi; fi" | 87 command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ] || otool -l \$lib | grep
-q LC_REEXPORT_DYLIB ; then $ld -shared \$ldflags -o \$lib -Wl,-filelist,\$rspfi
le \$solibs \$libs \$postbuilds && { otool -l \$lib | grep LC_ID_DYLIB -A 5; nm
-gP \$lib | cut -f1-2 -d' ' | grep -v U\$\$; true; } > \${lib}.TOC; else $ld -sh
ared \$ldflags -o \$lib \$in \$solibs \$libs \$postbuilds && { otool -l \$lib |
grep LC_ID_DYLIB -A 5; nm -gP \$lib | cut -f1-2 -d' ' | grep -v U\$\$; true; } >
\${lib}.tmp && if ! cmp -s \${lib}.tmp \${lib}.TOC; then mv \${lib}.tmp \${lib}
.TOC ; fi; fi" |
| 88 description = "SOLINK \$lib" | 88 description = "SOLINK \$lib" |
| 89 rspfile = "\$out.rsp" | 89 rspfile = "\$out.rsp" |
| 90 rspfile_content = "\$in_newline" | 90 rspfile_content = "\$in_newline" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 # Toolchain representing the target build (either mac or iOS). | 128 # Toolchain representing the target build (either mac or iOS). |
| 129 mac_clang_toolchain("clang") { | 129 mac_clang_toolchain("clang") { |
| 130 toolchain_os = os | 130 toolchain_os = os |
| 131 } | 131 } |
| 132 | 132 |
| 133 # This toolchain provides a way for iOS target compiles to reference targets | 133 # This toolchain provides a way for iOS target compiles to reference targets |
| 134 # compiled for the host system. It just overrides the OS back to "mac". | 134 # compiled for the host system. It just overrides the OS back to "mac". |
| 135 mac_clang_toolchain("host_clang") { | 135 mac_clang_toolchain("host_clang") { |
| 136 toolchain_os = "mac" | 136 toolchain_os = "mac" |
| 137 } | 137 } |
| OLD | NEW |