Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add protobuf sources to support building outside of cocoapods #19

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

elliottwilliams
Copy link

@elliottwilliams elliottwilliams commented Feb 12, 2021

v4.0.0 added a dependency on protobuf, and updated the podspec to declare this, but didn't update the xcodeproj itself. This broke Carthage support and prevents building from a clone of the repo.

This change:

  • Adds a protobuf submodule checked out at v3.14.0
  • Generates a protobuf.xcodeproj by running cmake -G Xcode -T buildsystem=1 -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES='$(ARCHS_STANDARD)' -DCMAKE_OSX_DEPLOYMENT_TARGET=11.1 protobuf/cmake
    • buildsystem=1: uses the legacy build system. protobuf specifies dependencies in such a way that cmake can't generate using the modern build system
    • CMAKE_OSX_SYSROOT=iphoneos: builds protobuf using the iOS SDK
    • CMAKE_OSX_ARCHITECTURES='$(ARCHS_STANDARD)': prevents cmake from settings ONLY_ACTIVE_ARCHS=NO, which causes simulator release builds of GTXiLib to fail
    • CMAKE_OSX_DEPLOYMENT_TARGET=11.1: matches the GTXiLib's deployment target
    • If you think it'd be useful, I can add a Makefile target to regenerate this project in the future
  • Creates a GTXiLib.xcworkspace which includes both projects
  • Configures the GTXiLib target to find headers from protobuf and link against libprotobuf

Testing done:

  • Builds in Debug and Release configurations for iOS and iOS Simulator (x86-64) targets
  • All tests pass except for GTXOOPFunctionalTests, where every test fails with No target application path specified via test configuration
    • I'm not sure whether I caused this – if there's a way to verify these tests on master i'd be happy to :)
  • pod spec lint . fails, but it also fails on master. not sure whether there's an issue in the podspec, or if it's something on my end?
  • carthage build --use-xcframeworks --no-skip-current succeeds

cmake -G Xcode -T buildsystem=1 -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES='$(ARCHS_STANDARD)' -DCMAKE_OSX_DEPLOYMENT_TARGET=11.1 protobuf/cmake
@kalkwarf
Copy link

Perhaps I misunderstand the PR, but I don't see GTXiLib.xcworkspace committed, nor do I spot a rule for cmake to generate it.

I'd sure love for this fix to land, so let me know how I can help. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants