Is it possible to build the C++ runtime without building the protoc compiler ?

61 views
Skip to first unread message

Fabrice Gautier

unread,
May 20, 2019, 4:50:10 PM5/20/19
to Protocol Buffers
Hi,

I'm trying to build just the C++ runtime library, without rebuilding the protoc compiler or requiring that protoc be available during the runtime build.

I'm looking at  building either or both the -lite and regular runtime library (depending on what is easier or doable)

Can the existing Makefile do this ? Or would this require makefile surgery ? 


Thanks.

Adam Cozzette

unread,
May 22, 2019, 3:57:22 PM5/22/19
to Fabrice Gautier, Protocol Buffers
Why do you want to avoid rebuilding protoc? I'm not sure offhand how easy it would be to avoid building it.

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/01680b5a-f02d-47d6-8310-2f44a3ad7b57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Fabrice Gautier

unread,
May 22, 2019, 4:12:39 PM5/22/19
to Protocol Buffers


On Wednesday, May 22, 2019 at 12:57:22 PM UTC-7, Adam Cozzette wrote:
Why do you want to avoid rebuilding protoc? I'm not sure offhand how easy it would be to avoid building it.

Because:
- The build environment is a cross compile environment that does not have a native toolchain.
- The build environment won't allow running executables that are generated by the build itself.
- So all the generated code is pre-generated and checked-in, so it's not needed.
- But I still need to build the runtime libraries.

It seems like other languages (eg: objective-C) can build their runtime without rebuilding a compiler, so it feels like C++ should be able to do the same.

Ideally, protoc and the runtime libraries would be part of that build environment / SDK, so that I could run protoc as part of the build and would not have to worry about rebuilding the runtime for my project, but that's not something I can control at this point.

And yes, I also have to accept the fact that I better be using the same version of protoc and the runtime I'm building.


On Mon, May 20, 2019 at 1:50 PM Fabrice Gautier <fabrice...@gmail.com> wrote:
Hi,

I'm trying to build just the C++ runtime library, without rebuilding the protoc compiler or requiring that protoc be available during the runtime build.

I'm looking at  building either or both the -lite and regular runtime library (depending on what is easier or doable)

Can the existing Makefile do this ? Or would this require makefile surgery ? 


Thanks.

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prot...@googlegroups.com.

Adam Cozzette

unread,
May 22, 2019, 4:17:47 PM5/22/19
to Fabrice Gautier, Protocol Buffers
Oh, I see. I have not looked into this in a while but you can run "./configure --with-protoc=..." to specify an alternative protoc to use during the build for cross-compiling. README.md has a bit more information on this.

To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.

To post to this group, send email to prot...@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.

hons...@gmail.com

unread,
Oct 2, 2020, 6:46:33 PM10/2/20
to Protocol Buffers
I have similar question, is there a way to only build c++ runtime? 
Reply all
Reply to author
Forward
0 new messages