From 2d071ec260efe196890dbacdbe9ffca8081e1edd Mon Sep 17 00:00:00 2001 From: Rich Gowman Date: Mon, 28 May 2018 14:23:41 -0400 Subject: Hookup serializer_test.cc to the xcode based test suite This involves: - building c++ libprotobuf (rather than just the obj-c version). - adding c++ libprotobuf, c++ built protos (previously created) to the *test suite* only (not to the main build). - modifying existing nanopb CFLAGS to match those that are indirectly pulled in. --- Firestore/Example/ProtobufCpp.podspec | 68 +++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Firestore/Example/ProtobufCpp.podspec (limited to 'Firestore/Example/ProtobufCpp.podspec') diff --git a/Firestore/Example/ProtobufCpp.podspec b/Firestore/Example/ProtobufCpp.podspec new file mode 100644 index 0000000..8090b1e --- /dev/null +++ b/Firestore/Example/ProtobufCpp.podspec @@ -0,0 +1,68 @@ +# Copyright 2018 Google +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# A Private podspec for Protobuf which exposes the C++ headers (rather than +# only the Obj-C headers). Suitable only for use inside this source tree. + +Pod::Spec.new do |s| + s.name = 'ProtobufCpp' + s.version = '3.5.2' + s.summary = 'Protocol Buffers v.3 runtime library for C++.' + s.homepage = 'https://github.com/google/protobuf' + s.license = '3-Clause BSD License' + s.authors = { 'The Protocol Buffers contributors' => 'protobuf@googlegroups.com' } + s.cocoapods_version = '>= 1.0' + + s.source = { + :git => 'https://github.com/google/protobuf.git', + :tag => "v#{s.version}" + } + + s.source_files = 'src/**/*.{h,cc}' + s.exclude_files = # skip test files. (Yes, the test files are intermixed with + # the source. No there doesn't seem to be a common/simple + # pattern we could use to exclude them; 'test' appears in + # various places throughout the file names and also in a + # non-test file. So, we'll exclude all files that either + # start with 'test' or include test and have a previous + # character that isn't "y" (so that bytestream isn't + # matched.)) + 'src/**/test*.*', + 'src/**/*[^y]test*.*', + 'src/**/testing/**', + 'src/**/mock*', + # skip the javascript handling code. + 'src/**/js/**', + # skip the protoc compiler + 'src/google/protobuf/compiler/**/*' + + s.header_mappings_dir = 'src/' + + # Set a CPP symbol so the code knows to use framework imports. + s.pod_target_xcconfig = { + 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1', + 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/ProtobufCpp/src"', + + # Cocoapods flattens header imports, leading to much anguish. The + # following two statements work around this. + # - https://github.com/CocoaPods/CocoaPods/issues/1437 + 'USE_HEADERMAP' => 'NO', + 'ALWAYS_SEARCH_USER_PATHS' => 'NO', + + 'OTHER_CFLAGS' => '-DHAVE_PTHREAD' + } + + s.requires_arc = false + s.library = 'c++' +end -- cgit v1.2.3