From 317482f1f0a0664b970f662fbf8c92e953c89edf Mon Sep 17 00:00:00 2001 From: Andy Chou Date: Tue, 21 Mar 2017 12:44:10 -0700 Subject: [PATCH] Fix Echo example and improve instructions Added header search path to the Echo example to allow it to build. Also added instructions to run the script in the third party directory to clone the swift-protobuf repo locally, which is required by the Echo example but not mentioned. Also update the toplevel readme to make the required make command explicit, and fix the name `swift-proto` to `swift-protobuf` --- .gitignore | 2 ++ .../Echo/Xcode/Echo.xcodeproj/project.pbxproj | 2 ++ Examples/README.md | 7 ++++++ README.md | 23 +++++++++++-------- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 901ff4800..062ffd4ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .DS_Store project.xcworkspace xcuserdata +.build +third_party/** diff --git a/Examples/Echo/Xcode/Echo.xcodeproj/project.pbxproj b/Examples/Echo/Xcode/Echo.xcodeproj/project.pbxproj index 18041da19..b3578a4d8 100644 --- a/Examples/Echo/Xcode/Echo.xcodeproj/project.pbxproj +++ b/Examples/Echo/Xcode/Echo.xcodeproj/project.pbxproj @@ -457,6 +457,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ../../../Sources/CgRPC/include; MACOSX_DEPLOYMENT_TARGET = 10.11; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; @@ -501,6 +502,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; + HEADER_SEARCH_PATHS = ../../../Sources/CgRPC/include; MACOSX_DEPLOYMENT_TARGET = 10.11; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; diff --git a/Examples/README.md b/Examples/README.md index 5f5dd547f..b754c18ce 100644 --- a/Examples/README.md +++ b/Examples/README.md @@ -1,6 +1,13 @@ # Examples +To build the Xcode examples, make sure required third party libraries +(specifically `swift-protobuf`) are retrieved by running the script in the +`third_party` toplevel directory: + + $ cd third_party + $ sh RUNME.sh + ## Swift gRPC generated code examples [Echo](Echo) diff --git a/README.md b/README.md index 4c5f5ad8e..e2f5a1d1c 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Swift Package Manager builds may also be made on Linux systems. Please see [DOCKER.md](DOCKER.md) and [LINUX.md](LINUX.md) for details. -## gRPC dependencies are vendored +## gRPC dependencies are vendored Swift gRPC now includes vendored copies of the gRPC core library and **BoringSSL**, an OpenSSL fork that is used by @@ -36,13 +36,18 @@ Manager builds. ## Building with Xcode -The top-level Makefile uses the Swift Package Manager to generate -an Xcode project for the SwiftGRPC package. Due to present limitations -in Package Manager configuration, the libz dependency is not included -in the generated Xcode project. If you get build errors about missing -symbols such as `_deflate`, `_deflateEnd`, etc., you can fix them by -adding `libz.tbd` to the **Link Binary With Libraries** build step of -the **CgRPC** target. +The top-level Makefile uses the Swift Package Manager to +generate an Xcode project for the SwiftGRPC package: + + $ make + +Then open `SwiftGRPC.xcodeproj` in Xcode. Due to present +limitations in Package Manager configuration, the libz +dependency is not included in the generated Xcode project. If +you get build errors about missing symbols such as +`_deflate`, `_deflateEnd`, etc., you can fix them by adding +`libz.tbd` to the **Link Binary With Libraries** build step +of the **CgRPC** target. ## Having build problems? @@ -51,7 +56,7 @@ testing with the following versions: - Xcode 8.2 - Swift 3.0.2 -- swift-proto 0.9.24 +- swift-protobuf 0.9.24 ## License