Do not leak dependencies of plugins #134
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously plugin dependencies declared with
DEPENDENCIESwould bePUBLICto the plugin's target. This means that e.g., include directories from the plugin's dependency would be added to any of its dependents as well.This not only increases the surface of what we might pull in inadvertently elsewhere, but also might cause unneeded rebuilds elsewhere if dependency paths change.
With this patch we declare any such dependencies
PRIVATE. This should only break code which previously did not correctly declare all its dependencies. This code is used both for internal as well is external plugins, and it seems to work well for internal code. For user code this is technically a breaking change, but I expect complex CMake dependencies between multiple plugins to be rare.