generate_descriptor_proto.sh 811 B

123456789101112131415161718192021222324252627
  1. #!/bin/sh
  2. # Run this script to regenerate descriptor.pb.{h,cc} after the protocol
  3. # compiler changes. Since these files are compiled into the protocol compiler
  4. # itself, they cannot be generated automatically by a make rule. "make check"
  5. # will fail if these files do not match what the protocol compiler would
  6. # generate.
  7. if test ! -e src/google/protobuf/stubs/common.h; then
  8. cat >&2 << __EOF__
  9. Could not find source code. Make sure you are running this script from the
  10. root of the distribution tree.
  11. __EOF__
  12. exit 1
  13. fi
  14. if test ! -e src/Makefile; then
  15. cat >&2 << __EOF__
  16. Could not find src/Makefile. You must run ./configure (and perhaps
  17. ./autogen.sh) first.
  18. __EOF__
  19. exit 1
  20. fi
  21. pushd src
  22. make protoc && ./protoc --cpp_out=dllexport_decl=LIBPROTOBUF_EXPORT:. google/protobuf/descriptor.proto
  23. popd