Skip to content
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

Allow one to omit building libprotoc and protoc binaries #3878

Merged
merged 1 commit into from
Nov 15, 2017

Conversation

Yangqing
Copy link
Contributor

Basically, in Android/iOS, if one uses the cmake script to do cross compiling, the js_embed target fails making the whole build fail. What one usually need in Android cross compilation probably do not include the protoc compiler, so this PR provides an option to turn it off.

Locally tested with cmake -Dprotobuf_BUILD_PROTOC_BINARIES=off && make && make install.

@grpc-kokoro
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

1 similar comment
@grpc-kokoro
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@Yangqing
Copy link
Contributor Author

Appveyor is passing and I don't think the travis failures are due to this PR. Would someone like to take a look and kick off jenkins?

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Nov 14, 2017

I think we should fix the build issue of js_embed rather than disabling protoc. More configuration options mean more maintenance overhead. Maybe we just need to tell cmake the js_embed binary is built for host someway?

@xfxyjwf xfxyjwf self-requested a review November 14, 2017 22:10
@Yangqing
Copy link
Contributor Author

@xfxyjwf I also agree that reducing the number of options is in general good.

In this case, I am a bit torn mainly because in cross-compilation stages, it would be tricky to require a protoc build because the toolchain would also need a host compiler. For example, when one uses gradle to build Android apps which further uses cmake, it makes life harder if one has to build js_embed for host (for example, it requires one to install the whole XCode).

Mixing cross-compilation and host compilation is also not very well supported by CMake IIRC.

Another option is to pass a protobuf_JS_EMBED_BINARY_PATH pointing to a prebuilt one, but that involves adding an option anyway, so this one is actually more preferred - build what you use and not any more.

@Yangqing
Copy link
Contributor Author

For possible solutions, see this thread:

https://cmake.org/pipermail/cmake/2013-January/053253.html

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Nov 15, 2017

I'm surprised cmake is lacking such basic support for cross-compiling. Without proper support from cmake this PR seems a reasonable workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants