When linking shared library, we shouldn't need to export linked
libraries to dependents, but we still need to do that for static
library. We should be explicit about this in target_link_libraries,
otherwise other targets that depend on these such as sanitizers get
repeated (and possibly even conflicting) dependencies.
Details
Details
- Reviewers
beanz ldionne mstorsjo - Commits
- rG8e7891544642: [CMake] Use correct visibility for linked libraries in CMake
rGb9128d8def87: [CMake] Use correct visibility for linked libraries in CMake
rUNW352688: [CMake] Use correct visibility for linked libraries in CMake
rL352688: [CMake] Use correct visibility for linked libraries in CMake
rCXXA352688: [CMake] Use correct visibility for linked libraries in CMake
rCXX352688: [CMake] Use correct visibility for linked libraries in CMake
rUNW352654: [CMake] Use correct visibility for linked libraries in CMake
rCXXA352654: [CMake] Use correct visibility for linked libraries in CMake
rCXX352654: [CMake] Use correct visibility for linked libraries in CMake
rL352654: [CMake] Use correct visibility for linked libraries in CMake
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
We hit this issue when trying to link libclang_rt.asan.so with static unwinder but shared libc++abi where we would get two different instances of libunwind, one from direct dependency and one from libc++abi.
Comment Actions
Wait, actually, doesn't CMake handle that automatically? I think that for STATIC libraries, even PRIVATE dependencies are forwarded to dependents, no?