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.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Alternative I also considered would be to use {{source_out_dir}}/{{label_name}}.dir/{{source_name_part}}.o which is what CMake does, the advantage is that you end up with prettier object file names (i.e. no label_name or target_output_name prefixes) which might matter for distribution archives like libc++.a.