GN: Put static libs next to .ninja files in output dir
This puts static libraries on mac next to their ninja files, i.e. in
locations like out/Debug/obj/base/libbase_static.a instead of directly
in the output directory. This matches what we do on other platforms and
avoids the need to give every static library a unique name in the GN
build. https://codereview.chromium.org/376773002/ has some discussion
of the history of why this is different in GYP.
Review URL: https://codereview.chromium.org/378123002
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e486cea820233e75bdb5c9c994414db08da0fd33
diff --git a/tools/gn/ninja_helper.cc b/tools/gn/ninja_helper.cc
index 75843ee..cc03dd5 100644
--- a/tools/gn/ninja_helper.cc
+++ b/tools/gn/ninja_helper.cc
@@ -180,10 +180,7 @@
// Binaries and loadable libraries go into the toolchain root.
if (target->output_type() == Target::EXECUTABLE ||
- (target->settings()->IsMac() &&
- (target->output_type() == Target::SHARED_LIBRARY ||
- target->output_type() == Target::STATIC_LIBRARY)) ||
- (target->settings()->IsWin() &&
+ ((target->settings()->IsMac() || target->settings()->IsWin()) &&
target->output_type() == Target::SHARED_LIBRARY)) {
// Generate a name like "<toolchain>/<prefix><name>.<extension>".
ret.value().append(prefix);