This should fix some compiler errors about a missing initializer when
building with -Wmissing-field-initializers on GCC 4.8.5. I think this
must be a GCC bug, so let's just work around it.
This will ensure that the build keeps going even if there is an error,
so that we can see as many results as possible without having to fix the
error and kick off another run.
When using a new enough CMake (3.15+) prefer to use the
`MSVC_RUNTIME_LIBRARY` property on targets to select the runtime library
variant. This property is automatically set to the value specified by
`CMAKE_MSVC_RUNTIME_LIBRARY`. This property requires that the CMake
Policy 91 is set to new (see CMP0091).
* Fix undefined symbol error around SharedCtor()
Apparently, #8532 was incorrect if applied to 3.17.x branch.
3.17.x changed code generation to mark `SharedCtor()` and `SharedDtor()` as inline in .pb.cc.
It looks like we have a compile-time undefined behavior in C++ now. As cppreference.com [says](https://en.cppreference.com/w/cpp/language/inline):
_The definition of an inline function <...> must be reachable in the translation unit where it is accessed (not necessarily before the point of access)._
As protobuf allows custom plugins to generate custom code, there is no limitation on where SharedCtor couble be possible referenced from. In our case we have SharedCtor invoked from corresponding `.pb.h` code, thus triggering:
```
ld: error: undefined symbol: package::Message::SharedCtor()`
>>> referenced by file.pb.h:$$$$
```
If this patch is not applicable, I can take a look into changing the code generation, but doing this will be harder then removing _inline_.
* Regenerate checked-in generated .pb.cc files