Skip to content

ObjC: Don't mangle filenames #864

@kientzle

Description

@kientzle

The Obj-C backend currently mangles the input filenames, converting e.g., foo_bar.proto to FooBar.pb.m. This causes problems for build systems (including Xcode) that could otherwise automatically track dependencies and recompile proto files only as needed.

The offending code is in src/google/protobuf/compiler/objectivec/objectivec_helpers.cc. The call to UnderscoresToCamelCase() here should be removed:

string FilePath(const FileDescriptor* file) {
string output;
string basename;
string directory;
PathSplit(file->name(), &directory, &basename);
if (directory.length() > 0) {
output = directory + "/";
}
basename = StripProto(basename);

// CamelCase to be more ObjC friendly.
basename = UnderscoresToCamelCase(basename, true);

output += basename;
return output;
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions