[ObjC] Add PROTOC_EXPORT for the CMake unittest build/link.

These aren't public api, but this is currently need for how the CMake build is
configured.
pull/10720/head
Thomas Van Lenten 2 years ago
parent 2e49a8de95
commit 9a4514c17b
  1. 3
      src/google/protobuf/compiler/objectivec/generator.h
  2. 14
      src/google/protobuf/compiler/objectivec/line_consumer.h
  3. 3
      src/google/protobuf/compiler/objectivec/names.h
  4. 10
      src/google/protobuf/compiler/objectivec/text_format_decode_data.h

@ -37,9 +37,8 @@
#include "google/protobuf/compiler/code_generator.h" #include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/descriptor.h" #include "google/protobuf/descriptor.h"
// clang-format off // Must be included last
#include "google/protobuf/port_def.inc" #include "google/protobuf/port_def.inc"
// clang-format on
namespace google { namespace google {
namespace protobuf { namespace protobuf {

@ -36,24 +36,30 @@
#include "google/protobuf/io/zero_copy_stream.h" #include "google/protobuf/io/zero_copy_stream.h"
// Must be included last
#include "google/protobuf/port_def.inc"
namespace google { namespace google {
namespace protobuf { namespace protobuf {
namespace compiler { namespace compiler {
namespace objectivec { namespace objectivec {
// TODO(b/250947994): PROTOC_EXPORT is only used to allow the CMake build to
// find/link these in the unittest, this is not public api.
// Helper for parsing simple files. // Helper for parsing simple files.
class LineConsumer { class PROTOC_EXPORT LineConsumer {
public: public:
LineConsumer(); LineConsumer();
virtual ~LineConsumer(); virtual ~LineConsumer();
virtual bool ConsumeLine(const absl::string_view& line, std::string* out_error) = 0; virtual bool ConsumeLine(const absl::string_view& line, std::string* out_error) = 0;
}; };
bool ParseSimpleFile(const std::string& path, bool PROTOC_EXPORT ParseSimpleFile(const std::string& path,
LineConsumer* line_consumer, LineConsumer* line_consumer,
std::string* out_error); std::string* out_error);
bool ParseSimpleStream(io::ZeroCopyInputStream& input_stream, bool PROTOC_EXPORT ParseSimpleStream(io::ZeroCopyInputStream& input_stream,
const std::string& stream_name, const std::string& stream_name,
LineConsumer* line_consumer, LineConsumer* line_consumer,
std::string* out_error); std::string* out_error);
@ -63,4 +69,6 @@ bool ParseSimpleStream(io::ZeroCopyInputStream& input_stream,
} // namespace protobuf } // namespace protobuf
} // namespace google } // namespace google
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_LINE_CONSUMER_H__ #endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_LINE_CONSUMER_H__

@ -39,9 +39,8 @@
#include "google/protobuf/descriptor.h" #include "google/protobuf/descriptor.h"
#include "google/protobuf/io/zero_copy_stream.h" #include "google/protobuf/io/zero_copy_stream.h"
// clang-format off // Must be included last
#include "google/protobuf/port_def.inc" #include "google/protobuf/port_def.inc"
// clang-format on
namespace google { namespace google {
namespace protobuf { namespace protobuf {

@ -34,14 +34,20 @@
#include <string> #include <string>
#include <vector> #include <vector>
// Must be included last
#include "google/protobuf/port_def.inc"
namespace google { namespace google {
namespace protobuf { namespace protobuf {
namespace compiler { namespace compiler {
namespace objectivec { namespace objectivec {
// TODO(b/250947994): PROTOC_EXPORT is only used to allow the CMake build to
// find/link these in the unittest, this is not public api.
// Generate decode data needed for ObjC's GPBDecodeTextFormatName() to transform // Generate decode data needed for ObjC's GPBDecodeTextFormatName() to transform
// the input into the expected output. // the input into the expected output.
class TextFormatDecodeData { class PROTOC_EXPORT TextFormatDecodeData {
public: public:
TextFormatDecodeData(); TextFormatDecodeData();
~TextFormatDecodeData(); ~TextFormatDecodeData();
@ -68,4 +74,6 @@ class TextFormatDecodeData {
} // namespace protobuf } // namespace protobuf
} // namespace google } // namespace google
#include "google/protobuf/port_undef.inc"
#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_TEXT_FORMAT_DECODE_DATA_H__ #endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_TEXT_FORMAT_DECODE_DATA_H__

Loading…
Cancel
Save