[PATCH] D54345: Add initial scaffolding for the GN build.

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 16 08:30:26 PST 2018


phosek added inline comments.


================
Comment at: llvm/utils/gn/secondary/llvm/lib/Demangle/BUILD.gn:2
+static_library("Demangle") {
+  output_name = "LLVMDemangle"
+
----------------
thakis wrote:
> phosek wrote:
> > Setting `output_name` explicitly is generally considered an anti-pattern and should be used only when absolutely necessary. I think we should just  `"LLVMDemangle"` as the target name.
> I had replied to this at https://reviews.llvm.org/D54345?id=173428#inline-480457
I missed that reply (Phabricator no longer shows that file because it was moved).

There are two downsides to manually specifying `output_name`:
  # You have to manually type it in each target which is also kind of annoying.
  # It's difficult to derive the output name from the target name which may be needed when dealing with packaging, copy rules, etc. (this is potentially YAGNI, but it's something we ran into Fuchsia on multiple occasions).




https://reviews.llvm.org/D54345





More information about the llvm-commits mailing list