Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2418)

Unified Diff: build/toolchain/mac/BUILD.gn

Issue 152683004: Work on GN GYP host build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests compiling Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/BUILDCONFIG.gn ('k') | tools/gn/builder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/toolchain/mac/BUILD.gn
diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn
index 1ff00b22e8dad68b4892e96268ebcb063fe81a5f..afd09e0a45f05e2b00e9fef88d67a2f8c04dfcab 100644
--- a/build/toolchain/mac/BUILD.gn
+++ b/build/toolchain/mac/BUILD.gn
@@ -53,68 +53,87 @@ gyp_mac_tool_source =
rebase_path("//tools/gyp/pylib/gyp/mac_tool.py", ".", root_build_dir)
exec_script("setup_toolchain.py", [ gyp_mac_tool_source ], "value")
-toolchain("clang") {
- # Make these apply to all tools below.
- lib_prefix = "-l"
- lib_dir_prefix="-L"
+# Shared toolchain definition. Invocations should set toolchain_os to set the
+# build args in this definition.
+template("mac_clang_toolchain") {
+ toolchain(target_name) {
+ # Make these apply to all tools below.
+ lib_prefix = "-l"
+ lib_dir_prefix="-L"
- tool("cc") {
- command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c \$cflags_pch_c -c \$in -o \$out"
- description = "CC \$out"
- depfile = "\$out.d"
- deps = "gcc"
- }
- tool("cxx") {
- command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc \$cflags_pch_cc -c \$in -o \$out"
- description = "CXX \$out"
- depfile = "\$out.d"
- deps = "gcc"
- }
- tool("objc") {
- command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c \$cflags_objc \$cflags_pch_objc -c \$in -o \$out"
- description = "OBJC \$out"
- depfile = "\$out.d"
- deps = "gcc"
- }
- tool("objcxx") {
- command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc \$cflags_objcc \$cflags_pch_objcc -c \$in -o \$out"
- description = "OBJCXX \$out"
- depfile = "\$out.d"
- deps = "gcc"
- }
- tool("alink") {
- command = "rm -f \$out && ./gyp-mac-tool filter-libtool libtool \$libtool_flags -static -o \$out \$in \$postbuilds"
- description = "LIBTOOL-STATIC \$out, POSTBUILDS"
- }
- tool("solink") {
- command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ] || otool -l \$lib | grep -q LC_REEXPORT_DYLIB ; then $ld -shared \$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}.TOC; else $ld -shared \$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"
- description = "SOLINK \$lib, POSTBUILDS"
- #pool = "link_pool"
- restat = "1"
- }
- tool("link") {
- command = "$ld \$ldflags -o \$out \$in \$solibs \$libs \$postbuilds"
- description = "LINK \$out, POSTBUILDS"
- #pool = "link_pool"
- }
- #tool("infoplist") {
- # command = "$cc -E -P -Wno-trigraphs -x c \$defines \$in -o \$out && plutil -convert xml1 \$out \$out"
- # description = "INFOPLIST \$out"
- #}
- #tool("mac_tool") {
- # command = "\$env ./gyp-mac-tool \$mactool_cmd \$in \$out"
- # description = "MACTOOL \$mactool_cmd \$in"
- #}
- #tool("package_framework") {
- # command = "./gyp-mac-tool package-framework \$out \$version \$postbuilds && touch \$out"
- # description = "PACKAGE FRAMEWORK \$out, POSTBUILDS"
- #}
- tool("stamp") {
- command = "\${postbuilds}touch \$out"
- description = "STAMP \$out"
- }
- tool("copy") {
- command = "ln -f \$in \$out 2>/dev/null || (rm -rf \$out && cp -af \$in \$out)"
- description = "COPY \$in \$out"
+ tool("cc") {
+ command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c \$cflags_pch_c -c \$in -o \$out"
+ description = "CC \$out"
+ depfile = "\$out.d"
+ deps = "gcc"
+ }
+ tool("cxx") {
+ command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc \$cflags_pch_cc -c \$in -o \$out"
+ description = "CXX \$out"
+ depfile = "\$out.d"
+ deps = "gcc"
+ }
+ tool("objc") {
+ command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c \$cflags_objc \$cflags_pch_objc -c \$in -o \$out"
+ description = "OBJC \$out"
+ depfile = "\$out.d"
+ deps = "gcc"
+ }
+ tool("objcxx") {
+ command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc \$cflags_objcc \$cflags_pch_objcc -c \$in -o \$out"
+ description = "OBJCXX \$out"
+ depfile = "\$out.d"
+ deps = "gcc"
+ }
+ tool("alink") {
+ command = "rm -f \$out && ./gyp-mac-tool filter-libtool libtool \$libtool_flags -static -o \$out \$in \$postbuilds"
+ description = "LIBTOOL-STATIC \$out, POSTBUILDS"
+ }
+ tool("solink") {
+ command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ] || otool -l \$lib | grep -q LC_REEXPORT_DYLIB ; then $ld -shared \$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}.TOC; else $ld -shared \$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"
+ description = "SOLINK \$lib, POSTBUILDS"
+ #pool = "link_pool"
+ restat = "1"
+ }
+ tool("link") {
+ command = "$ld \$ldflags -o \$out \$in \$solibs \$libs \$postbuilds"
+ description = "LINK \$out, POSTBUILDS"
+ #pool = "link_pool"
+ }
+ #tool("infoplist") {
+ # command = "$cc -E -P -Wno-trigraphs -x c \$defines \$in -o \$out && plutil -convert xml1 \$out \$out"
+ # description = "INFOPLIST \$out"
+ #}
+ #tool("mac_tool") {
+ # command = "\$env ./gyp-mac-tool \$mactool_cmd \$in \$out"
+ # description = "MACTOOL \$mactool_cmd \$in"
+ #}
+ #tool("package_framework") {
+ # command = "./gyp-mac-tool package-framework \$out \$version \$postbuilds && touch \$out"
+ # description = "PACKAGE FRAMEWORK \$out, POSTBUILDS"
+ #}
+ tool("stamp") {
+ command = "\${postbuilds}touch \$out"
+ description = "STAMP \$out"
+ }
+ tool("copy") {
+ command = "ln -f \$in \$out 2>/dev/null || (rm -rf \$out && cp -af \$in \$out)"
+ description = "COPY \$in \$out"
+ }
+
+ toolchain_args() {
+ os = toolchain_os
+ }
}
}
+
+# Toolchain representing the target build (either mac or iOS).
+mac_clang_toolchain("clang") {
+ toolchain_os = os
+}
+
+# This toolchain provides a way for iOS target compiles to reference targets
+# compiled for the host system. It just overrides the OS back to "mac".
+mac_clang_toolchain("host_clang") {
+ toolchain_os = "mac"
+}
« no previous file with comments | « build/config/BUILDCONFIG.gn ('k') | tools/gn/builder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698