-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: fix linking protobuf #4185
Conversation
This was broken by the refactoring for building with static libraries (c21aec2 mixxxdj#4163): mixxxdj#4163 (comment) https://mixxx.zulipchat.com/#narrow/stream/247620-development-help/topic/cmake.20fails.20with.20Could.20NOT.20find.20Protobuf
cfb3757
to
d172f78
Compare
include(IsStaticLibrary) | ||
if(TARGET protobuf::libprotobuf-lite) | ||
target_link_libraries(mixxx-proto PRIVATE protobuf::libprotobuf-lite) | ||
is_static_library(Protobuf_USE_STATIC_LIBS protobuf::libprotobuf-lite) |
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.
I'm doubt this is even needed. Protobuf_USE_STATIC_LIBS is a parameter for the Protobuf find module (https://cmake.org/cmake/help/latest/module/FindProtobuf.html) so I don't think it does anything after the find_package(Protobuf REQURIED)
.
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.
Oh yes. So lets remove it entirely. Do we have still a use case for setting it from Mixxx? If so, we can reintroduce it.
Pull Request Test Coverage Report for Build 1105940102
💛 - Coveralls |
Nice solution, to be honest I have not understand how it has ever worked. |
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,
(this was the last questionable use of BUILD_SHARED_LIBS)
Yes, BUILD_SHARED_LIBS is for setting how to link libraries being built by CMake, not for specifying whether dependencies are shared or static. |
This was broken by the refactoring for building with static
libraries (c21aec2 #4163):
#4163 (comment)
https://mixxx.zulipchat.com/#narrow/stream/247620-development-help/topic/cmake.20fails.20with.20Could.20NOT.20find.20Protobuf