-
Notifications
You must be signed in to change notification settings - Fork 2
libprotobuf cmake fix #132
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ project(ipfs_client | |
| ) | ||
| set(old_path ${CMAKE_MODULE_PATH}) | ||
| set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR};${CMAKE_CURRENT_BINARY_DIR}) | ||
|
|
||
| include(FindProtobuf) | ||
| if(IN_WORKSPACE) | ||
| include(../cmake/setup.cmake) | ||
| list(APPEND CMAKE_MODULE_PATH ${old_path}) | ||
|
|
@@ -17,7 +17,6 @@ else() | |
| find_package(nlohmann_json QUIET REQUIRED CONFIG) | ||
| find_package( | ||
| Protobuf | ||
| ${protobuf_version} | ||
| QUIET | ||
| REQUIRED | ||
| CONFIG | ||
|
|
@@ -74,7 +73,7 @@ target_include_directories(ic_proto | |
| ) | ||
| target_link_libraries(ic_proto | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. First of all, thanks for your PR! Secondly, I want to apologize. This codebase is in a transition and there's no way you could've known that. The logical "head" of this target is actually over here at least for now while waiting on an answer about something else... If I can get my head around your use case and reproduce the issue then I'll move a version of your fix into the place I'll need things to be as I clean up my mess.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. my use case was just getting the following to work on ubuntu noble LTS:
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I appreciate the info. Your versions are reasonably close to my own, well within what I intended to support. And that cmake command was definitely intended to work. |
||
| PUBLIC | ||
| protobuf::protobuf | ||
| protobuf::libprotobuf | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ) | ||
|
|
||
| add_library(ipfs_client | ||
|
|
||
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.
This would break my workflow - it would allow CMake to find system-installed or Chromium-installed protobuf.
The most important thing is of course that your libprotobuf version matches your protoc version exactly.
Should I assume you're trying not to use conan?
Would it be helpful if we had the version to be passed into the CMake part of the build (which is typically run by conan, but shouldn't have to be) as a variable like
cmake -D PROTOBUF_VERSION=5.27.0?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 using conan. removing the version check might have been unnecessary, the blocker for me was the fix below on line 76
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.
and prob because im using the dev version of protobuf
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.
Thanks for pointing it out. I think "libprotobuf" is just more correct regardless, but I'll check to make sure it works for me.
Is it OK if I leave this PR open here for a while? You can use your fork for now and after I get my stuff together I'll let you know and we'll see if things work OK for you... sound good?
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.
yeah let's leave it open as things shake out