Branch: refs/heads/main
Revision: 77707006b87c0e3ff3147341980f838a1fb0771c
Author: jabraham17
Link: Fix protoc gen with newer versions of protobuf by jabraham17 · Pull Request #28829 · chapel-lang/chapel · GitHub
Log Message:
Fix protoc gen with newer versions of protobuf (#28829)
Fixes the protoc-gen-chpl tool with newer versions of protobuf which use
string_view instead of string
Key changes
- adjust the build to not duplicate
-lprotobufand remove-I.
(switched to""includes for local headers) - use
std::string_viewin some cases and careful use ofauto. This
should make it so that no matter the version of protobuf, the code
compiles properly without the use of conditional macros - stop using
using namespace std, as thats a major anti-pattern
[Reviewed by @dlongnecke-cray]
Diff:
M tools/protoc-gen-chpl/Makefile
M tools/protoc-gen-chpl/enum.cpp
M tools/protoc-gen-chpl/enum_field.cpp
M tools/protoc-gen-chpl/enum_field.h
M tools/protoc-gen-chpl/field_base.cpp
M tools/protoc-gen-chpl/field_base.h
M tools/protoc-gen-chpl/generator.cpp
M tools/protoc-gen-chpl/generator.h
M tools/protoc-gen-chpl/helpers.cpp
M tools/protoc-gen-chpl/helpers.h
M tools/protoc-gen-chpl/map_field.cpp
M tools/protoc-gen-chpl/map_field.h
M tools/protoc-gen-chpl/message.cpp
M tools/protoc-gen-chpl/message.h
M tools/protoc-gen-chpl/message_field.cpp
M tools/protoc-gen-chpl/message_field.h
M tools/protoc-gen-chpl/primitive_field.cpp
M tools/protoc-gen-chpl/primitive_field.h
M tools/protoc-gen-chpl/protoc-gen-chpl.cpp
M tools/protoc-gen-chpl/reflection_class.cpp
M tools/protoc-gen-chpl/reflection_class.h
M tools/protoc-gen-chpl/repeated_enum_field.cpp
M tools/protoc-gen-chpl/repeated_enum_field.h
M tools/protoc-gen-chpl/repeated_message_field.cpp
M tools/protoc-gen-chpl/repeated_message_field.h
M tools/protoc-gen-chpl/repeated_primitive_field.cpp
M tools/protoc-gen-chpl/repeated_primitive_field.h
https://github.com/chapel-lang/chapel/pull/28829.diff