Overdue followup to https://github.com/protocolbuffers/protobuf/pull/7173
Since all the files are at the same level as the runtime headers, there is no
need for things to be framework based imports, they should all just work like
the other headers do.
- Directly generate the bundled header imports into the preamble section when
generating for a bundled proto.
- Update the preamble generation to skip the CPP wrapper when generating for a
bundled proto file.
- Regenerate the WKTs.
- Update GPBProtocolBuffer.h/GPBWellKnownTypes.h to also skip the CPP wrapping.
GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS in the podspec and non bundled files still
has to exist because that comes into play for those files to find the runtime
headers.
This version defaults all the options, so folks don't have to pass it.
Since Options never had a PROTOC_EXPORT, it isn't immediately clear how well the
existing api worked for any shared lib cases, so this should give a simpler api
for the basic usage (if anyone wants to use it).
The other generation options never were in the Options structure and
ImportWriter was the only thing that needed some the non validation options and
it already required directly passing the options. So refine Options to just be
validation options and bundle all the File related generation options into
a new FileGenerator specific GenerationOptions.
This PR tells git to ignore ephemeral files that are created when
developers use clangd.
clangd needs a `compile_commands.json` file at the root of the repo (or
in a `build/` directory) to tell it how to compile each file. CMake can
generate this file with something like the following:
```console
$ cmake -Scmake -B.build \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-Dprotobuf_BUILD_TESTS=OFF
$ ln -sf .build/compile_commands.json .
```
Then clangd will compile and index files into the `.cache` directory.
Two small fixes to update_version.py:
- The regex for updating SOVERSION in cmake files was not quite right. I
fixed it to reflect that the value is a plain integer and not of the
form x.y.z
- For some reason the code for updating PHP_PROTO_VERSION appeared 3
times and led to a spurious warning, so I removed the extra calls
there.
Now that two files use the format, tweak the naming to the format for the file
vs. the usage(s).
Also add a "usage" param so the two places can provide a little context for any
error messages generated while parsing.
Soname was set for libprotobuf.so in commit a9cf69a0ed,
but similar changes for libprotobuf-lite.so and libprotoc.so were missed.
Fixes: #8635
Co-authored-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@GMail.Com>