aboutsummaryrefslogtreecommitdiff
path: root/objectivec/GPBWellKnownTypes.h
diff options
context:
space:
mode:
authorThomas Van Lenten <thomasvl@google.com>2016-05-09 13:53:20 -0400
committerBo Yang <teboring@google.com>2016-06-13 13:55:00 -0700
commit72df8446975d018616a4ff97f1d79f55c6d21af8 (patch)
tree832b81f7f30d6915221b4087b265cfb4b61b4ad5 /objectivec/GPBWellKnownTypes.h
parent1445ce2809511d2af2ef0f80685a16385c3fff71 (diff)
downloadprotobuf-72df8446975d018616a4ff97f1d79f55c6d21af8.tar.gz
protobuf-72df8446975d018616a4ff97f1d79f55c6d21af8.tar.bz2
protobuf-72df8446975d018616a4ff97f1d79f55c6d21af8.zip
Better support for using the proto library from a framework.
- Add generator constant for the default framework name. - Add generator api for making the CPP symbol from the name. - Add generator api to see if it is a bundled proto file. - Output a CPP conditional and two imports for the core library headers. - Add helper for generating the #import for file headers to deal with the framework imports. - Add a reference from the unittests to a WKT to use that to inspect how imports generate. - Update the podspec to define the CPP symbol and require pods 1.0 (or later). Fixes https://github.com/google/protobuf/issues/1457
Diffstat (limited to 'objectivec/GPBWellKnownTypes.h')
-rw-r--r--objectivec/GPBWellKnownTypes.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/objectivec/GPBWellKnownTypes.h b/objectivec/GPBWellKnownTypes.h
index 28442fbe..311ac58e 100644
--- a/objectivec/GPBWellKnownTypes.h
+++ b/objectivec/GPBWellKnownTypes.h
@@ -30,8 +30,19 @@
#import <Foundation/Foundation.h>
-#import "google/protobuf/Duration.pbobjc.h"
-#import "google/protobuf/Timestamp.pbobjc.h"
+// This CPP symbol can be defined to use imports that match up to the framework
+// imports needed when using CocoaPods.
+#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS)
+ #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0
+#endif
+
+#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS
+ #import <Protobuf/Duration.pbobjc.h>
+ #import <Protobuf/Timestamp.pbobjc.h>
+#else
+ #import "google/protobuf/Duration.pbobjc.h"
+ #import "google/protobuf/Timestamp.pbobjc.h"
+#endif
NS_ASSUME_NONNULL_BEGIN