[llvm] r359494 - [gn] Use label_name rather than target_output_name for objects
Petr Hosek via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 29 13:04:20 PDT 2019
Author: phosek
Date: Mon Apr 29 13:04:20 2019
New Revision: 359494
URL: http://llvm.org/viewvc/llvm-project?rev=359494&view=rev
Log:
[gn] Use label_name rather than target_output_name for objects
Multiple targets in the same output directory can use the same
target_output_name. The typical example of that is having a shared
and a static library of the same, e.g. libc++.so and libc++.a.
When that's the case, the object files produced for each target
are going to conflict. Using the label_name avoids this conflict
since labels are guaranteed to be unique within a single BUILD.gn
file which corresponds to a single output directory.
Differential Revision: https://reviews.llvm.org/D60329
Modified:
llvm/trunk/utils/gn/build/toolchain/BUILD.gn
Modified: llvm/trunk/utils/gn/build/toolchain/BUILD.gn
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/gn/build/toolchain/BUILD.gn?rev=359494&r1=359493&r2=359494&view=diff
==============================================================================
--- llvm/trunk/utils/gn/build/toolchain/BUILD.gn (original)
+++ llvm/trunk/utils/gn/build/toolchain/BUILD.gn Mon Apr 29 13:04:20 2019
@@ -19,7 +19,7 @@ template("unix_toolchain") {
depsformat = "gcc"
description = "CC {{output}}"
outputs = [
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
+ "{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o"
]
}
@@ -29,7 +29,7 @@ template("unix_toolchain") {
depsformat = "gcc"
description = "CXX {{output}}"
outputs = [
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
+ "{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o"
]
}
@@ -39,7 +39,7 @@ template("unix_toolchain") {
depsformat = "gcc"
description = "ASM {{output}}"
outputs = [
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o",
+ "{{source_out_dir}}/{{label_name}}.{{source_name_part}}.o"
]
}
@@ -227,7 +227,7 @@ toolchain("win") {
depsformat = "msvc"
description = "CC {{output}}"
outputs = [
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj",
+ "{{source_out_dir}}/{{label_name}}.{{source_name_part}}.obj",
]
}
@@ -236,7 +236,7 @@ toolchain("win") {
depsformat = "msvc"
description = "CXX {{output}}"
outputs = [
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.obj",
+ "{{source_out_dir}}/{{label_name}}.{{source_name_part}}.obj",
]
}
More information about the llvm-commits
mailing list