-
Notifications
You must be signed in to change notification settings - Fork 45
Enable cross building for Android and iOS #51
Enable cross building for Android and iOS #51
Conversation
The upstream patch is already in the 1.35.0 release (grpc/grpc@8a546ca). I would rather like to see it updated to that (a change in required dependencies needs to be checked for that too) |
Sure, the patch can be dropped when grpc is updated to 135.0. Anyway, I don't think the interesting part is that patch. It's the other small, but important, changes that |
conanfile.py
Outdated
# When cross building the recipe depends on itself to provide the plugins | ||
if tools.cross_building(self.settings): | ||
self.build_requires( | ||
f"{self.name}/{self.version}@{self.user}/{self.channel}") |
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.
While in principle Conan is still supporting Python 2, supporting Python 2 in recipes would be ideal. But at the very minimum, it has to support Python 3.5+
Please don't use f-strings
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.
Sure! I'm just so used to being able to use them :)
test_package/CMakeLists.txt
Outdated
find_program(_PROTOBUF_PROTOC protoc ${CONAN_BIN_DIRS_PROTOBUF} NO_DEFAULT_PATH) | ||
|
||
# Find protoc | ||
find_program(_PROTOBUF_PROTOC protoc REQUIRED) |
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 change means that a pre-installed protoc can be found which is not desired
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.
For cross complication to work find_program
needs to rely on finding protoc
through the PATH variable, not CONAN_BIN_DIRS_PROTOBUF.
You shouldn't find the system protoc
because the protobuf package sets up the path correctly:
https://github.com/conan-io/conan-center-index/blob/4116c939117a47bf4c4285aeec2a857e6b9b7165/recipes/protobuf/all/conanfile.py#L203
I have not been able to find any other way to do this with Conan...
The protobuf PR in CCI (conan-io/conan-center-index#4556) makes sure
the path is setup correctly when using dual profiles (to make sure you find the build protoc).
Removed the f-strings. |
Also, just out of curiosity. What's stopping this recipe from being added to CCI? |
Hey @Croydon Could you take a look again at this PR and if it's fine merge it? |
If protoc has been built by both host and build profile this makes sure CMake finds protoc for the build profile See discussion in: conan-io/conan-center-index#4556
c0a2b58
to
12f3dff
Compare
After these (conan-io/conan-center-index#4556) changes to protobuf was merged in CCI |
instead of PROTOC_PROGRAM.
Updated to use the more standard |
This recipe is now in the Conan Center Index. Please migrate to the recipe version there. Thanks! |
Allows grpc to be cross built using dual profiles (profile host/build).
Disables plugins when cross building and the recipe instead depends on itself to provide the plugins.
The patch is needed for the iOS build. Relates to OpenSSL stuff.
It's already fixed in master but not in 1.34.1. See grpc/grpc#24959
Cross building for Android and iOS depends on this PR to protobuf: conan-io/conan-center-index#4556
Cross building for iOS build also depends on this PR to c-ares: conan-io/conan-center-index#4492
Tested on both Android and iOS:
Android profile:
iOS profile: