How to support different architectures on podspec?

In my company, we use a third-party static library that comes with the wrapper class, and I want to create a module for it. We have two versions of the static library, for the simulator and the device. The folder with the files that I want to include in the module is as follows:

Engine
|
|- libEngine.a
|
|- libEngine-Simulator.a
|
|- Engine.h
|
|- EngineWrapper.h
|
|- EngineWrapper.mm
|
|- SomeOtherFile.bin

Now, since:

  • The library only supports armv7
  • EngineWrapper.mm not using ARC
  • there is a requirement to establish CLANG_CXX_LIBRARYin libstdc++and
  • SomeOtherFile.binshould be "seen" Engine.h,

the related part of my podspec looks like this:

s.requires_arc = false
s.source_files = 'Classes/ios/Engine'
s.preserve_path = 'Classes/ios/Engine/SomeOtherFile.bin', 'Classes/ios/Engine/libEngine-Simulator.a', 'Classes/ios/Engine/libEngine.a'
s.vendored_libraries = 'Classes/ios/Engine/libEngine-Simulator.a', 'Classes/ios/Engine/libEngine.a'
s.xcconfig  =  { 'CLANG_CXX_LIBRARY' => 'libstdc++', 'VALID_ARCHS' => 'armv7' }

/ , . , . , , , :

Undefined armv7

Pods.xcodeproj, - ( , Cocoapods ).

, :

  • ( Classes/ios/Engine)
  • libraries vendored_libraries
  • .
  • zip ( TestFlight podspec)
  • VALID_ARCHS

podspec, , .

Cocoapods ver 0.32.1.

, , , . !

+4

Source: https://habr.com/ru/post/1538845/


All Articles