diff options
-rw-r--r-- | cmake/protobuf-config.cmake.in | 30 | ||||
-rw-r--r-- | cmake/protobuf-module.cmake.in | 4 | ||||
-rw-r--r-- | docs/third_party.md | 3 | ||||
-rwxr-xr-x | python/google/protobuf/internal/decoder.py | 2 | ||||
-rwxr-xr-x | python/google/protobuf/internal/encoder.py | 2 |
5 files changed, 24 insertions, 17 deletions
diff --git a/cmake/protobuf-config.cmake.in b/cmake/protobuf-config.cmake.in index 41ab5095..fd67edc3 100644 --- a/cmake/protobuf-config.cmake.in +++ b/cmake/protobuf-config.cmake.in @@ -49,9 +49,23 @@ function(protobuf_generate) endif() endif() + if(protobuf_generate_TARGET) + get_target_property(_source_list ${protobuf_generate_TARGET} SOURCES) + foreach(_file ${_source_list}) + if(_file MATCHES "proto$") + list(APPEND protobuf_generate_PROTOS ${_file}) + endif() + endforeach() + endif() + + if(NOT protobuf_generate_PROTOS) + message(SEND_ERROR "Error: protobuf_generate could not find any .proto files") + return() + endif() + if(protobuf_generate_APPEND_PATH) # Create an include path for each file specified - foreach(_file ${ARGN}) + foreach(_file ${protobuf_generate_PROTOS}) get_filename_component(_abs_file ${_file} ABSOLUTE) get_filename_component(_abs_path ${_abs_file} PATH) list(FIND _protobuf_include_path ${_abs_path} _contains_already) @@ -71,20 +85,6 @@ function(protobuf_generate) endif() endforeach() - if(protobuf_generate_TARGET) - get_target_property(_source_list ${protobuf_generate_TARGET} SOURCES) - foreach(_file ${_source_list}) - if(_file MATCHES "proto$") - list(APPEND protobuf_generate_PROTOS ${_file}) - endif() - endforeach() - endif() - - if(NOT protobuf_generate_PROTOS) - message(SEND_ERROR "Error: protobuf_generate could not find any .proto files") - return() - endif() - set(_generated_srcs_all) foreach(_proto ${protobuf_generate_PROTOS}) get_filename_component(_abs_file ${_proto} ABSOLUTE) diff --git a/cmake/protobuf-module.cmake.in b/cmake/protobuf-module.cmake.in index 85f891be..74c54887 100644 --- a/cmake/protobuf-module.cmake.in +++ b/cmake/protobuf-module.cmake.in @@ -150,6 +150,10 @@ if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}") get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc IMPORTED_LOCATION_DEBUG) endif() +if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}") + get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc + IMPORTED_LOCATION_NOCONFIG) +endif() # Version info variable set(Protobuf_VERSION "@protobuf_VERSION@") diff --git a/docs/third_party.md b/docs/third_party.md index 5d2695d8..b20d4cb1 100644 --- a/docs/third_party.md +++ b/docs/third_party.md @@ -42,7 +42,9 @@ These are projects we know about implementing Protocol Buffers for other program * Go: https://github.com/golang/protobuf (Google-official implementation) * Go: https://github.com/akunspy/gopbuf * Go: https://github.com/gogo/protobuf +* GopherJS: https://github.com/johanbrandhorst/protobuf * Haskell: http://hackage.haskell.org/package/hprotoc +* Haskell: https://github.com/google/proto-lens (Google-unofficial implementation) * Haxe: https://github.com/Atry/protoc-gen-haxe * Java: https://github.com/google/protobuf (Google-official implementation) * Java/Android: https://github.com/square/wire @@ -119,6 +121,7 @@ GRPC (http://www.grpc.io/) is Google's RPC implementation for Protocol Buffers. * https://github.com/madwyn/libpbrpc (C++) * https://github.com/SeriousMa/grpc-protobuf-validation (Java) * https://github.com/tony612/grpc-elixir (Elixir) +* https://github.com/johanbrandhorst/protobuf (GopherJS) ## Other Utilities diff --git a/python/google/protobuf/internal/decoder.py b/python/google/protobuf/internal/decoder.py index ff3e6d30..52b64915 100755 --- a/python/google/protobuf/internal/decoder.py +++ b/python/google/protobuf/internal/decoder.py @@ -181,7 +181,7 @@ def ReadTag(buffer, pos): while six.indexbytes(buffer, pos) & 0x80: pos += 1 pos += 1 - return (buffer[start:pos], pos) + return (six.binary_type(buffer[start:pos]), pos) # -------------------------------------------------------------------- diff --git a/python/google/protobuf/internal/encoder.py b/python/google/protobuf/internal/encoder.py index 8c6a1189..40c62d67 100755 --- a/python/google/protobuf/internal/encoder.py +++ b/python/google/protobuf/internal/encoder.py @@ -418,7 +418,7 @@ def _VarintBytes(value): def TagBytes(field_number, wire_type): """Encode the given tag and return the bytes. Only called at startup.""" - return _VarintBytes(wire_format.PackTag(field_number, wire_type)) + return six.binary_type( _VarintBytes(wire_format.PackTag(field_number, wire_type)) ) # -------------------------------------------------------------------- # As with sizers (see above), we have a number of common encoder |