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

Unified Diff: build/toolchain/gcc_toolchain.gni

Issue 1882973002: Allow targets to override the output directory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@output_dir
Patch Set: 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 | « no previous file | no next file » | 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
index e2b98e06939138f45a7f34a65990a4efdcc7630a..77bc16f26ad01ff382262fe30ca6d58f16e71a17 100644
--- a/build/toolchain/gcc_toolchain.gni
+++ b/build/toolchain/gcc_toolchain.gni
@@ -234,23 +234,25 @@ template("gcc_toolchain") {
description = "AR {{output}}"
rspfile_content = "{{inputs}}"
outputs = [
- "{{target_out_dir}}/{{target_output_name}}{{output_extension}}",
+ "{{output_dir}}/{{target_output_name}}{{output_extension}}",
]
+
+ # Shared libraries go in the target out directory by default so we can
+ # generate different targets with the same name and not have them collide.
+ default_output_dir = "{{target_out_dir}}"
default_output_extension = ".a"
output_prefix = "lib"
}
tool("solink") {
soname = "{{target_output_name}}{{output_extension}}" # e.g. "libfoo.so".
- sofile = "{{root_out_dir}}/$soname" # Possibly including toolchain dir.
- if (shlib_subdir != ".") {
- sofile = "{{root_out_dir}}/$shlib_subdir/$soname"
- }
+ sofile = "{{output_dir}}/$soname" # Possibly including toolchain dir.
rspfile = sofile + ".rsp"
- unstripped_sofile = sofile
if (defined(invoker.strip)) {
unstripped_sofile = "{{root_out_dir}}/lib.unstripped/$soname"
+ } else {
+ unstripped_sofile = sofile
}
# These variables are not built into GN but are helpers that
@@ -283,6 +285,11 @@ template("gcc_toolchain") {
# specifies).
default_output_extension = default_shlib_extension
+ default_output_dir = "{{root_out_dir}}"
+ if (shlib_subdir != ".") {
+ default_output_dir += "/$shlib_subdir"
+ }
+
output_prefix = "lib"
# Since the above commands only updates the .TOC file when it changes, ask
@@ -305,15 +312,13 @@ template("gcc_toolchain") {
tool("solink_module") {
soname = "{{target_output_name}}{{output_extension}}" # e.g. "libfoo.so".
- sofile = "{{root_out_dir}}/$soname" # Possibly including toolchain dir.
- if (shlib_subdir != ".") {
- sofile = "{{root_out_dir}}/$shlib_subdir/$soname"
- }
+ sofile = "{{output_dir}}/$soname"
rspfile = sofile + ".rsp"
- unstripped_sofile = sofile
if (defined(invoker.strip)) {
unstripped_sofile = "{{root_out_dir}}/lib.unstripped/$soname"
+ } else {
+ unstripped_sofile = sofile
}
command = "$ld -shared {{ldflags}} -o \"$unstripped_sofile\" -Wl,-soname=\"$soname\" @\"$rspfile\""
@@ -335,6 +340,11 @@ template("gcc_toolchain") {
default_output_extension = default_shlib_extension
}
+ default_output_dir = "{{root_out_dir}}"
+ if (shlib_subdir != ".") {
+ default_output_dir += "/$shlib_subdir"
+ }
+
output_prefix = "lib"
outputs = [
@@ -347,7 +357,7 @@ template("gcc_toolchain") {
tool("link") {
exename = "{{target_output_name}}{{output_extension}}"
- outfile = "{{root_out_dir}}/$exename"
+ outfile = "{{output_dir}}/$exename"
rspfile = "$outfile.rsp"
unstripped_outfile = outfile
@@ -356,6 +366,8 @@ template("gcc_toolchain") {
# specifies).
default_output_extension = default_executable_extension
+ default_output_dir = "{{root_out_dir}}"
+
if (defined(invoker.strip)) {
unstripped_outfile = "{{root_out_dir}}/exe.unstripped/$exename"
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698