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

Unified Diff: tools/gn/example/build/toolchain/BUILD.gn

Issue 1887533003: Add an output_dir override to GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: const Created 4 years, 8 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 | « tools/gn/docs/reference.md ('k') | tools/gn/function_toolchain.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/example/build/toolchain/BUILD.gn
diff --git a/tools/gn/example/build/toolchain/BUILD.gn b/tools/gn/example/build/toolchain/BUILD.gn
index 77e33fecf61aa24580990fd5ca1119b2705f36ef..d9457d7eae4030f326fec4f384a9e49950b3e7fc 100644
--- a/tools/gn/example/build/toolchain/BUILD.gn
+++ b/tools/gn/example/build/toolchain/BUILD.gn
@@ -37,9 +37,10 @@ toolchain("gcc") {
tool("solink") {
soname = "{{target_output_name}}{{output_extension}}" # e.g. "libfoo.so".
+ sofile = "{{output_dir}}/$soname"
rspfile = soname + ".rsp"
- command = "g++ -shared {{ldflags}} -o $soname -Wl,-soname=$soname @$rspfile"
+ command = "g++ -shared {{ldflags}} -o $sofile -Wl,-soname=$soname @$rspfile"
rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive {{libs}}"
description = "SOLINK $soname"
@@ -49,11 +50,15 @@ toolchain("gcc") {
# specifies).
default_output_extension = ".so"
+ # Use this for {{output_dir}} expansions unless a target manually overrides
+ # it (in which case {{output_dir}} will be what the target specifies).
+ default_output_dir = "{{root_out_dir}}"
+
outputs = [
- soname,
+ sofile,
]
- link_output = soname
- depend_output = soname
+ link_output = sofile
+ depend_output = sofile
output_prefix = "lib"
}
@@ -62,6 +67,7 @@ toolchain("gcc") {
rspfile = "$outfile.rsp"
command = "g++ {{ldflags}} -o $outfile -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group {{libs}}"
description = "LINK $outfile"
+ default_output_dir = "{{root_out_dir}}"
rspfile_content = "{{inputs}}"
outputs = [
outfile,
« no previous file with comments | « tools/gn/docs/reference.md ('k') | tools/gn/function_toolchain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698