diff options
author | Michael Staib <mstaib@google.com> | 2016-07-15 20:00:39 +0000 |
---|---|---|
committer | Yun Peng <pcloudy@google.com> | 2016-07-18 10:44:02 +0000 |
commit | a2770334ea3f3111026eb3e1368586921468710c (patch) | |
tree | fac21caba6f82c05c3a5bd496b39a1cd0b610fa8 /src/main/cpp/util | |
parent | bdc2ecbb1b415161c45359d612ec60fa219c45fb (diff) |
Stop input and output of cc_library from clobbering each other.
Before this change:
Any given cc_library can only contribute one library with a given name to
targets which depend on it. If an input library has the same name as the
cc_library which it is an input to, the decision of which to use is based
on the link mode. e.g.,
cc_library(
name = "foo",
srcs = ["foo.c", "libfoo.so"],
)
will only contribute libfoo.a (a static library containing foo.o) in static mode,
while it will only contribute libfoo.so (the precompiled shared library) in dynamic
mode.
This change alters cc_library's behavior in this case:
* If libfoo.a would be empty (i.e., there are no linkable sources), then
this is allowed. The libfoo.so from srcs is simply passed through. (Previously,
the empty libfoo.a would be forwarded.)
* Otherwise, this is an error.
In the case where there are multiple libraries in the srcs with the same
library identifier (lib[name].[a|so|lo]), cc_library will still choose one
based on the link mode. This behavior has not changed.
Similarly, cc_library will still choose one of its own outputs based on the
link mode. That behavior has not changed either.
RELNOTES[INC]: It is now an error to include a precompiled library (.a, .lo, .so)
in a cc_library which would generate a library with the same name
(e.g., libfoo.so in cc_library foo) if that library also contains other linkable
sources.
--
MOS_MIGRATED_REVID=127569615
Diffstat (limited to 'src/main/cpp/util')
0 files changed, 0 insertions, 0 deletions