More seamless SwiftPM implementation (#567)

This update allows clients to share common syntax for nanopb imports/includes between CocoaPods and Swift Package Manager.

See example at firebase/firebase-ios-sdk#6165
This commit is contained in:
Paul Beusterien authored and GitHub committed 2020-08-07 12:38:52 +03:00
1 parent 4502555fd3
commit 3cfa21200e
14 files changed
+25 -12

No files matched your search

+8 -1
View File
@@ -12,6 +12,13 @@ let package = Package(
.watchOS(.v2)
],
products: [
.library(
name: "nanopb",
targets: ["nanopb"]
)
],
targets: [
.target(
name: "nanopb",
@@ -25,7 +32,7 @@ let package = Package(
"pb_encode.h",
"pb_encode.c"
],
publicHeadersPath: "SwiftPackage",
publicHeadersPath: "spm_headers",
cSettings: [
.define("PB_FIELD_32BIT", to: "1"),
.define("PB_NO_PACKED_STRUCTS", to: "1"),
-5
View File
@@ -1,5 +0,0 @@
module nanopb {
umbrella header "nanopb.h"
export *
}
-4
View File
@@ -1,4 +0,0 @@
#import "../pb.h"
#import "../pb_common.h"
#import "../pb_decode.h"
#import "../pb_encode.h"
+3 -1
View File
@@ -1 +1,3 @@
#include "nanopb.h"
#include "pb.h"
#include "pb_common.h"
#include "pb_decode.h"
+3 -1
View File
@@ -1 +1,3 @@
#import "nanopb.h"
#import "pb.h"
#import <pb_common.h>
#include "pb_decode.h"
+3
View File
@@ -0,0 +1,3 @@
#import "nanopb/pb.h"
#import <nanopb/pb_common.h>
#include "nanopb/pb_decode.h"
+1
View File
@@ -0,0 +1 @@
../../pb.h
+1
View File
@@ -0,0 +1 @@
../../pb_common.h
+1
View File
@@ -0,0 +1 @@
../../pb_decode.h
+1
View File
@@ -0,0 +1 @@
../../pb_encode.h
+1
View File
@@ -0,0 +1 @@
#include "nanopb/pb.h"
+1
View File
@@ -0,0 +1 @@
#include "nanopb/pb_common.h"
+1
View File
@@ -0,0 +1 @@
#include "nanopb/pb_decode.h"
+1
View File
@@ -0,0 +1 @@
#include "nanopb/pb_encode.h"