Skip to content

Commit e556805

Browse files
committed
Update remaining examples to remove explicit -lz linker commands.
Libz is now provided by an imported package. Note that Xcode builds that use swift-proto may fail due to a problem in the 0.9.903 version: apple/swift-protobuf#570
1 parent b75af16 commit e556805

File tree

7 files changed

+270
-185
lines changed

7 files changed

+270
-185
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ Plugin/Packages/**
77
Plugin/protoc-*
88
Plugin/swiftgrpc.log
99
Plugin/echo.*.swift
10+
SwiftGRPC.xcodeproj

Examples/Datastore/PackageManager/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11

2-
LDFLAGS = -Xlinker -lz
3-
42
all:
5-
swift build -v $(LDFLAGS)
3+
swift build
64
cp .build/debug/Datastore .
75

86
clean :

Examples/Echo/Xcode/Echo.xcodeproj/project.pbxproj

Lines changed: 161 additions & 131 deletions
Large diffs are not rendered by default.

Examples/Simple/PackageManager/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11

2-
LDFLAGS = -Xlinker -lz
3-
42
all:
5-
swift build -v $(LDFLAGS)
3+
swift build
64

75
clean :
86
rm -rf Packages

Examples/Simple/Xcode/Simple.xcodeproj/project.pbxproj

Lines changed: 103 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -15,54 +15,75 @@
1515
/* End PBXBuildFile section */
1616

1717
/* Begin PBXContainerItemProxy section */
18-
D31F110B1EA933160067D424 /* PBXContainerItemProxy */ = {
18+
D3E1EA701EE8AFEB0024A93A /* PBXContainerItemProxy */ = {
1919
isa = PBXContainerItemProxy;
20-
containerPortal = D31F11041EA933160067D424 /* SwiftGRPC.xcodeproj */;
20+
containerPortal = D3E1EA671EE8AFEB0024A93A /* SwiftGRPC.xcodeproj */;
2121
proxyType = 2;
22-
remoteGlobalIDString = OBJ_778;
22+
remoteGlobalIDString = OBJ_803;
23+
remoteInfo = "zlib-example";
24+
};
25+
D3E1EA721EE8AFEB0024A93A /* PBXContainerItemProxy */ = {
26+
isa = PBXContainerItemProxy;
27+
containerPortal = D3E1EA671EE8AFEB0024A93A /* SwiftGRPC.xcodeproj */;
28+
proxyType = 2;
29+
remoteGlobalIDString = OBJ_804;
30+
remoteInfo = Czlib;
31+
};
32+
D3E1EA741EE8AFEB0024A93A /* PBXContainerItemProxy */ = {
33+
isa = PBXContainerItemProxy;
34+
containerPortal = D3E1EA671EE8AFEB0024A93A /* SwiftGRPC.xcodeproj */;
35+
proxyType = 2;
36+
remoteGlobalIDString = OBJ_805;
2337
remoteInfo = CgRPC;
2438
};
25-
D31F110D1EA933160067D424 /* PBXContainerItemProxy */ = {
39+
D3E1EA761EE8AFEB0024A93A /* PBXContainerItemProxy */ = {
2640
isa = PBXContainerItemProxy;
27-
containerPortal = D31F11041EA933160067D424 /* SwiftGRPC.xcodeproj */;
41+
containerPortal = D3E1EA671EE8AFEB0024A93A /* SwiftGRPC.xcodeproj */;
2842
proxyType = 2;
29-
remoteGlobalIDString = OBJ_779;
43+
remoteGlobalIDString = OBJ_806;
3044
remoteInfo = BoringSSL;
3145
};
32-
D31F110F1EA933160067D424 /* PBXContainerItemProxy */ = {
46+
D3E1EA781EE8AFEB0024A93A /* PBXContainerItemProxy */ = {
3347
isa = PBXContainerItemProxy;
34-
containerPortal = D31F11041EA933160067D424 /* SwiftGRPC.xcodeproj */;
48+
containerPortal = D3E1EA671EE8AFEB0024A93A /* SwiftGRPC.xcodeproj */;
3549
proxyType = 2;
36-
remoteGlobalIDString = OBJ_780;
50+
remoteGlobalIDString = OBJ_807;
3751
remoteInfo = gRPC;
3852
};
39-
D31F11111EA933160067D424 /* PBXContainerItemProxy */ = {
53+
D3E1EA7A1EE8AFEB0024A93A /* PBXContainerItemProxy */ = {
4054
isa = PBXContainerItemProxy;
41-
containerPortal = D31F11041EA933160067D424 /* SwiftGRPC.xcodeproj */;
55+
containerPortal = D3E1EA671EE8AFEB0024A93A /* SwiftGRPC.xcodeproj */;
4256
proxyType = 2;
43-
remoteGlobalIDString = OBJ_781;
57+
remoteGlobalIDString = OBJ_808;
4458
remoteInfo = gRPCTests;
4559
};
46-
D31F11191EA9333F0067D424 /* PBXContainerItemProxy */ = {
60+
D3E1EA7C1EE8B0070024A93A /* PBXContainerItemProxy */ = {
61+
isa = PBXContainerItemProxy;
62+
containerPortal = D3E1EA671EE8AFEB0024A93A /* SwiftGRPC.xcodeproj */;
63+
proxyType = 1;
64+
remoteGlobalIDString = OBJ_1428;
65+
remoteInfo = gRPC;
66+
};
67+
D3E1EA7E1EE8B00C0024A93A /* PBXContainerItemProxy */ = {
4768
isa = PBXContainerItemProxy;
48-
containerPortal = D31F11041EA933160067D424 /* SwiftGRPC.xcodeproj */;
69+
containerPortal = D3E1EA671EE8AFEB0024A93A /* SwiftGRPC.xcodeproj */;
4970
proxyType = 1;
50-
remoteGlobalIDString = OBJ_782;
71+
remoteGlobalIDString = OBJ_840;
5172
remoteInfo = CgRPC;
5273
};
53-
D31F111B1EA9333F0067D424 /* PBXContainerItemProxy */ = {
74+
D3E1EA801EE8B0120024A93A /* PBXContainerItemProxy */ = {
5475
isa = PBXContainerItemProxy;
55-
containerPortal = D31F11041EA933160067D424 /* SwiftGRPC.xcodeproj */;
76+
containerPortal = D3E1EA671EE8AFEB0024A93A /* SwiftGRPC.xcodeproj */;
5677
proxyType = 1;
57-
remoteGlobalIDString = OBJ_1062;
58-
remoteInfo = BoringSSL;
78+
remoteGlobalIDString = OBJ_818;
79+
remoteInfo = Czlib;
5980
};
60-
D31F111D1EA9333F0067D424 /* PBXContainerItemProxy */ = {
81+
D3E1EA821EE8B0120024A93A /* PBXContainerItemProxy */ = {
6182
isa = PBXContainerItemProxy;
62-
containerPortal = D31F11041EA933160067D424 /* SwiftGRPC.xcodeproj */;
83+
containerPortal = D3E1EA671EE8AFEB0024A93A /* SwiftGRPC.xcodeproj */;
6384
proxyType = 1;
64-
remoteGlobalIDString = OBJ_1366;
65-
remoteInfo = gRPC;
85+
remoteGlobalIDString = OBJ_1122;
86+
remoteInfo = BoringSSL;
6687
};
6788
/* End PBXContainerItemProxy section */
6889

@@ -74,7 +95,7 @@
7495
D30D73611D565E4400F90CCB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
7596
D30D73641D565E4400F90CCB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
7697
D30D73661D565E4400F90CCB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
77-
D31F11041EA933160067D424 /* SwiftGRPC.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftGRPC.xcodeproj; path = ../../../SwiftGRPC.xcodeproj; sourceTree = "<group>"; };
98+
D3E1EA671EE8AFEB0024A93A /* SwiftGRPC.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftGRPC.xcodeproj; path = ../../../SwiftGRPC.xcodeproj; sourceTree = "<group>"; };
7899
/* End PBXFileReference section */
79100

80101
/* Begin PBXFrameworksBuildPhase section */
@@ -91,7 +112,7 @@
91112
D30D734E1D565E4400F90CCB = {
92113
isa = PBXGroup;
93114
children = (
94-
D31F11041EA933160067D424 /* SwiftGRPC.xcodeproj */,
115+
D3E1EA671EE8AFEB0024A93A /* SwiftGRPC.xcodeproj */,
95116
D30D73591D565E4400F90CCB /* Simple */,
96117
D30D73581D565E4400F90CCB /* Products */,
97118
);
@@ -118,13 +139,15 @@
118139
path = Simple;
119140
sourceTree = "<group>";
120141
};
121-
D31F11051EA933160067D424 /* Products */ = {
142+
D3E1EA681EE8AFEB0024A93A /* Products */ = {
122143
isa = PBXGroup;
123144
children = (
124-
D31F110C1EA933160067D424 /* CgRPC.framework */,
125-
D31F110E1EA933160067D424 /* BoringSSL.framework */,
126-
D31F11101EA933160067D424 /* gRPC.framework */,
127-
D31F11121EA933160067D424 /* gRPCTests.xctest */,
145+
D3E1EA711EE8AFEB0024A93A /* zlib-example */,
146+
D3E1EA731EE8AFEB0024A93A /* Czlib.framework */,
147+
D3E1EA751EE8AFEB0024A93A /* CgRPC.framework */,
148+
D3E1EA771EE8AFEB0024A93A /* BoringSSL.framework */,
149+
D3E1EA791EE8AFEB0024A93A /* gRPC.framework */,
150+
D3E1EA7B1EE8AFEB0024A93A /* gRPCTests.xctest */,
128151
);
129152
name = Products;
130153
sourceTree = "<group>";
@@ -143,6 +166,10 @@
143166
buildRules = (
144167
);
145168
dependencies = (
169+
D3E1EA811EE8B0120024A93A /* PBXTargetDependency */,
170+
D3E1EA831EE8B0120024A93A /* PBXTargetDependency */,
171+
D3E1EA7F1EE8B00C0024A93A /* PBXTargetDependency */,
172+
D3E1EA7D1EE8B0070024A93A /* PBXTargetDependency */,
146173
D31F111A1EA9333F0067D424 /* PBXTargetDependency */,
147174
D31F111C1EA9333F0067D424 /* PBXTargetDependency */,
148175
D31F111E1EA9333F0067D424 /* PBXTargetDependency */,
@@ -183,8 +210,8 @@
183210
projectDirPath = "";
184211
projectReferences = (
185212
{
186-
ProductGroup = D31F11051EA933160067D424 /* Products */;
187-
ProjectRef = D31F11041EA933160067D424 /* SwiftGRPC.xcodeproj */;
213+
ProductGroup = D3E1EA681EE8AFEB0024A93A /* Products */;
214+
ProjectRef = D3E1EA671EE8AFEB0024A93A /* SwiftGRPC.xcodeproj */;
188215
},
189216
);
190217
projectRoot = "";
@@ -195,32 +222,46 @@
195222
/* End PBXProject section */
196223

197224
/* Begin PBXReferenceProxy section */
198-
D31F110C1EA933160067D424 /* CgRPC.framework */ = {
225+
D3E1EA711EE8AFEB0024A93A /* zlib-example */ = {
226+
isa = PBXReferenceProxy;
227+
fileType = "compiled.mach-o.executable";
228+
path = "zlib-example";
229+
remoteRef = D3E1EA701EE8AFEB0024A93A /* PBXContainerItemProxy */;
230+
sourceTree = BUILT_PRODUCTS_DIR;
231+
};
232+
D3E1EA731EE8AFEB0024A93A /* Czlib.framework */ = {
233+
isa = PBXReferenceProxy;
234+
fileType = wrapper.framework;
235+
path = Czlib.framework;
236+
remoteRef = D3E1EA721EE8AFEB0024A93A /* PBXContainerItemProxy */;
237+
sourceTree = BUILT_PRODUCTS_DIR;
238+
};
239+
D3E1EA751EE8AFEB0024A93A /* CgRPC.framework */ = {
199240
isa = PBXReferenceProxy;
200241
fileType = wrapper.framework;
201242
path = CgRPC.framework;
202-
remoteRef = D31F110B1EA933160067D424 /* PBXContainerItemProxy */;
243+
remoteRef = D3E1EA741EE8AFEB0024A93A /* PBXContainerItemProxy */;
203244
sourceTree = BUILT_PRODUCTS_DIR;
204245
};
205-
D31F110E1EA933160067D424 /* BoringSSL.framework */ = {
246+
D3E1EA771EE8AFEB0024A93A /* BoringSSL.framework */ = {
206247
isa = PBXReferenceProxy;
207248
fileType = wrapper.framework;
208249
path = BoringSSL.framework;
209-
remoteRef = D31F110D1EA933160067D424 /* PBXContainerItemProxy */;
250+
remoteRef = D3E1EA761EE8AFEB0024A93A /* PBXContainerItemProxy */;
210251
sourceTree = BUILT_PRODUCTS_DIR;
211252
};
212-
D31F11101EA933160067D424 /* gRPC.framework */ = {
253+
D3E1EA791EE8AFEB0024A93A /* gRPC.framework */ = {
213254
isa = PBXReferenceProxy;
214255
fileType = wrapper.framework;
215256
path = gRPC.framework;
216-
remoteRef = D31F110F1EA933160067D424 /* PBXContainerItemProxy */;
257+
remoteRef = D3E1EA781EE8AFEB0024A93A /* PBXContainerItemProxy */;
217258
sourceTree = BUILT_PRODUCTS_DIR;
218259
};
219-
D31F11121EA933160067D424 /* gRPCTests.xctest */ = {
260+
D3E1EA7B1EE8AFEB0024A93A /* gRPCTests.xctest */ = {
220261
isa = PBXReferenceProxy;
221262
fileType = file;
222263
path = gRPCTests.xctest;
223-
remoteRef = D31F11111EA933160067D424 /* PBXContainerItemProxy */;
264+
remoteRef = D3E1EA7A1EE8AFEB0024A93A /* PBXContainerItemProxy */;
224265
sourceTree = BUILT_PRODUCTS_DIR;
225266
};
226267
/* End PBXReferenceProxy section */
@@ -254,17 +295,34 @@
254295
D31F111A1EA9333F0067D424 /* PBXTargetDependency */ = {
255296
isa = PBXTargetDependency;
256297
name = CgRPC;
257-
targetProxy = D31F11191EA9333F0067D424 /* PBXContainerItemProxy */;
258298
};
259299
D31F111C1EA9333F0067D424 /* PBXTargetDependency */ = {
260300
isa = PBXTargetDependency;
261301
name = BoringSSL;
262-
targetProxy = D31F111B1EA9333F0067D424 /* PBXContainerItemProxy */;
263302
};
264303
D31F111E1EA9333F0067D424 /* PBXTargetDependency */ = {
265304
isa = PBXTargetDependency;
266305
name = gRPC;
267-
targetProxy = D31F111D1EA9333F0067D424 /* PBXContainerItemProxy */;
306+
};
307+
D3E1EA7D1EE8B0070024A93A /* PBXTargetDependency */ = {
308+
isa = PBXTargetDependency;
309+
name = gRPC;
310+
targetProxy = D3E1EA7C1EE8B0070024A93A /* PBXContainerItemProxy */;
311+
};
312+
D3E1EA7F1EE8B00C0024A93A /* PBXTargetDependency */ = {
313+
isa = PBXTargetDependency;
314+
name = CgRPC;
315+
targetProxy = D3E1EA7E1EE8B00C0024A93A /* PBXContainerItemProxy */;
316+
};
317+
D3E1EA811EE8B0120024A93A /* PBXTargetDependency */ = {
318+
isa = PBXTargetDependency;
319+
name = Czlib;
320+
targetProxy = D3E1EA801EE8B0120024A93A /* PBXContainerItemProxy */;
321+
};
322+
D3E1EA831EE8B0120024A93A /* PBXTargetDependency */ = {
323+
isa = PBXTargetDependency;
324+
name = BoringSSL;
325+
targetProxy = D3E1EA821EE8B0120024A93A /* PBXContainerItemProxy */;
268326
};
269327
/* End PBXTargetDependency section */
270328

@@ -326,7 +384,7 @@
326384
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
327385
GCC_WARN_UNUSED_FUNCTION = YES;
328386
GCC_WARN_UNUSED_VARIABLE = YES;
329-
HEADER_SEARCH_PATHS = ../../../Sources/CgRPC/include;
387+
HEADER_SEARCH_PATHS = ../../../Sources/CgRPC/include;
330388
MACOSX_DEPLOYMENT_TARGET = 10.11;
331389
MTL_ENABLE_DEBUG_INFO = YES;
332390
ONLY_ACTIVE_ARCH = YES;
@@ -368,7 +426,7 @@
368426
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
369427
GCC_WARN_UNUSED_FUNCTION = YES;
370428
GCC_WARN_UNUSED_VARIABLE = YES;
371-
HEADER_SEARCH_PATHS = ../../../Sources/CgRPC/include;
429+
HEADER_SEARCH_PATHS = ../../../Sources/CgRPC/include;
372430
MACOSX_DEPLOYMENT_TARGET = 10.11;
373431
MTL_ENABLE_DEBUG_INFO = NO;
374432
SDKROOT = macosx;

Plugin/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build: clear
99
cp .build/debug/protoc-gen-swift .
1010

1111
test: build
12-
protoc ../Examples/Echo/echo.proto --proto_path=../Examples/Echo --plugin=./protoc-gen-swiftgrpc --swiftgrpc_out=.
12+
protoc ../Examples/Echo/echo.proto --proto_path=../Examples/Echo --plugin=./protoc-gen-swiftgrpc --swiftgrpc_out=. --swift_out=.
1313
diff echo.client.pb.swift ../Examples/Echo/Generated/echo.client.pb.swift
1414
diff echo.server.pb.swift ../Examples/Echo/Generated/echo.server.pb.swift
1515

third_party/RUNME.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
printf "\033c"
1818
read -p "Would you like to download swift-protobuf / grpc [y/N]" CONDITION;
1919
if [ "$CONDITION" == "y" ] ; then
20-
read -p "Use last known stable swift-protobuf - 0.9.901 ? or latest master ? [S/l] " CONDITION;
20+
read -p "Use last known stable swift-protobuf - 0.9.903 ? or latest master ? [S/l] " CONDITION;
2121
if [ "$CONDITION" == "l" ] ; then
2222
git clone https://github.com/apple/swift-protobuf.git
2323
else
24-
git clone -b 0.9.901 https://github.com/apple/swift-protobuf.git
24+
git clone -b 0.9.903 https://github.com/apple/swift-protobuf.git
2525
fi
2626
git clone https://github.com/grpc/grpc.git
2727
cd grpc

0 commit comments

Comments
 (0)