-
Notifications
You must be signed in to change notification settings - Fork 507
Support build proto as shared lib on Windows #3714
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR enables building Protocol Buffer (protobuf) targets as shared libraries on Windows by implementing proper DLL export/import declarations. Previously, protobuf targets were forced to be static libraries on Windows, but this change adds the necessary infrastructure to support shared library builds across platforms.
Key changes:
- Added CMake helper functions for managing export/import declarations across different compilers and platforms
- Modified protobuf generation to include
dllexport_declparameter for proper Windows DLL support - Removed Windows-specific restriction forcing static library builds for protobuf targets
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| cmake/tools.cmake | Adds utility functions for generating platform and compiler-specific DLL export/import declarations |
| cmake/opentelemetry-proto.cmake | Integrates DLL declarations into protobuf targets, removes Windows static-only restriction, and adds formatting improvements |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3714 +/- ##
=======================================
Coverage 90.01% 90.01%
=======================================
Files 225 225
Lines 7105 7105
=======================================
Hits 6395 6395
Misses 710 710 🚀 New features to boost your workflow:
|
|
My MSVC have LNK2001 unresolved external symbol for |
c45538c to
39314ef
Compare
Adds warnings to inform users when the build type for `opentelemetry-proto` is automatically adjusted to maintain consistency with protobuf, potentially overriding the global `BUILD_SHARED_LIBS` setting.
01b3a7c to
1a4630c
Compare
Fixes #3665
Fixes #3620
Changes
dllexport_declfor proto targets and can be built as shared on windows.For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes