-
Notifications
You must be signed in to change notification settings - Fork 483
[CMAKE] remove global include_directories usage and rely on target properties #3426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CMAKE] remove global include_directories usage and rely on target properties #3426
Conversation
✅ Deploy Preview for opentelemetry-cpp-api-docs canceled.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3426 +/- ##
=======================================
Coverage 90.04% 90.04%
=======================================
Files 212 212
Lines 6937 6937
=======================================
Hits 6246 6246
Misses 691 691 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Seems this is a breaking change if the user relies on the |
@ThomsonTan I don't expect any breaking changes to users. The scope of the |
FYI, here is one case which relied on |
That is a good catch. One of the drawbacks with the global include_directories (and why it is good to move towards target_include_directories) is that it can hide issues like this since the global includes are not transitive with the targets. The fix you made in open-telemetry/opentelemetry-cpp-contrib#551 is a good one. Another instance where issues were hidden is with the foo_* library examples. They had included the sdk headers but did not link to the sdk targets (and shouldn't have). If a user copied those examples and the cmake files to build in their project - they would have previously failed to find the sdk headers at compile time. |
More cmake cleanup.
Changes
include_directories
calls in favor oftarget_include_directories
. Make sure the targets relying on these global includes link/include what they need.foo_*
example libraries (These example libraries should link to the api only)For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes