Xcode 7 中的脂肪库

Fat library in Xcode 7

我在使用 Xcode 工具链为 Boost 构建胖库时遇到问题。在脚本中进行一些修复后构建本身工作正常但是当我在项目中使用它时我收到链接器错误:

ld: in boost.framework/boost(atomic_lockpool.o), building for iOS simulator, but linking in object file built for OSX, for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我还在 Apple Developer Forums 上找到了 same problem,但没有任何解决方案,只是人们报告了同样的问题。

lipo -info 输出:

Architectures in the fat file: boost.framework/boost are: armv7 armv7s i386 x86_64 arm64

现在 bjam.

需要附加标志 cxxflags="-miphoneos-version-min=7.0"

下面是 bjam 调用现在的样子(对于模拟器):

bjam -j$(CORES) --build-dir=$(IPHONESIM_BUILD_DIR) --stagedir=$(IPHONESIM_STAGE_DIR) --toolset=darwin-$(IPHONE_SDKVERSION)~iphonesim cxxflags="-miphoneos-version-min=7.0" architecture=x86 target-os=iphone macosx-version=iphonesim-$(IPHONE_SDKVERSION) link=static