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

Unified Diff: build/toolchain/gcc_toolchain.gni

Issue 117863003: Work on GN toolchain definitions and build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 7 years 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/toolchain/clang.gni ('k') | build/toolchain/get_default_posix_goma_dir.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/toolchain/gcc_toolchain.gni
diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni
new file mode 100644
index 0000000000000000000000000000000000000000..e1f8a8941c2f0d9b624e8b11004b76ab9767e188
--- /dev/null
+++ b/build/toolchain/gcc_toolchain.gni
@@ -0,0 +1,68 @@
+# Copyright (c) 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This template defines a GCC toolchain.
+#
+# It requires the following variables specifying the executables to run:
+# - cc
+# - cxx
+# - ar
+# - ld
+# and the following which is used in the toolchain_args
+# - toolchain_cpu_arch (What "cpu_arch" should be set to when invoking a
+# build using this toolchain.)
+# - toolchain_os (What "os" should be set to when invoking a build using this
+# toolchain.)
+template("gcc_toolchain") {
+ toolchain(target_name) {
+ # Make these apply to all tools below.
+ lib_prefix = "-l"
+ lib_dir_prefix="-L"
+
+ tool("cc") {
+ # cflags_pch_c
+ command = "$cc -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_c -c \$in -o \$out"
+ description = "CC \$out"
+ depfile = "\$out.d"
+ deps = "gcc"
+ }
+ tool("cxx") {
+ # cflags_pch_cc
+ command = "$cxx -MMD -MF \$out.d \$defines \$includes \$cflags \$cflags_cc -c \$in -o \$out"
+ description = "CXX \$out"
+ depfile = "\$out.d"
+ deps = "gcc"
+ }
+ tool("alink") {
+ command = "rm -f \$out && $ar rcs \$out \$in"
+ description = "AR \$out"
+ }
+ tool("solink") {
+ command = "if [ ! -e \$lib -o ! -e \${lib}.TOC ]; then $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { readelf -d \${lib} | grep SONAME ; nm -gD -f p \${lib} | cut -f1-2 -d' '; } > \${lib}.TOC; else $ld -shared \$ldflags -o \$lib -Wl,-soname=\$soname -Wl,--whole-archive \$in \$solibs -Wl,--no-whole-archive \$libs && { 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"
+ description = "SOLINK \$lib"
+ #pool = "link_pool"
+ restat = "1"
+ }
+ tool("link") {
+ command = "$ld \$ldflags -o \$out -Wl,--start-group \$in \$solibs -Wl,--end-group \$libs"
+ description = "LINK \$out"
+ #pool = "link_pool"
+ }
+ 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"
+ }
+
+ # When invoking this toolchain not as the default one, these args will be
+ # passed to the build. They are ignored when this is the default toolchain.
+ toolchain_args() {
+ cpu_arch = toolchain_cpu_arch
+ os = toolchain_os
+ }
+ }
+}
« no previous file with comments | « build/toolchain/clang.gni ('k') | build/toolchain/get_default_posix_goma_dir.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698