]> granicus.if.org Git - llvm/commitdiff
[gn] Use label_name rather than target_output_name for objects
authorPetr Hosek <phosek@chromium.org>
Mon, 29 Apr 2019 20:04:20 +0000 (20:04 +0000)
committerPetr Hosek <phosek@chromium.org>
Mon, 29 Apr 2019 20:04:20 +0000 (20:04 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359494 91177308-0d34-0410-b5e6-96231b3b80d8

utils/gn/build/toolchain/BUILD.gn

index a2c653ff1ceb01b2a8aaa1345c4b55557ba6676a..c6734a4884828124bbe9529bb8309a62e7175a5e 100644 (file)
@@ -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",
     ]
   }