From: Petr Hosek Date: Mon, 29 Apr 2019 20:04:20 +0000 (+0000) Subject: [gn] Use label_name rather than target_output_name for objects X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88c3ba17c4cf991329cf2b06837c68f88f540b89;p=llvm [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359494 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/gn/build/toolchain/BUILD.gn b/utils/gn/build/toolchain/BUILD.gn index a2c653ff1ce..c6734a48848 100644 --- a/utils/gn/build/toolchain/BUILD.gn +++ b/utils/gn/build/toolchain/BUILD.gn @@ -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", ] }