xcode 使用 buildscript 添加嵌入式二进制文件 [英] xcode add embedded binary with buildscript
问题描述
我从第三方获得了一个动态框架,由于缺少符号,该框架在链接器阶段无法在基于 X86_64 的架构上编译,我曾多次要求他们将此架构与他们的框架捆绑在一起,但他们直到现在才能够这样做.
I have been given a dynamic framework from a third party which does not compile on X86_64 based archs at linker stage due missing symbols, I have asked them repeatedly bundle this architecture with their framework, but they haven't been able to do so until now.
现在我的问题如下,无论如何我找不到使用构建设置添加阶段嵌入式二进制阶段,在构建/链接器过程中嵌入式二进制文件如何链接到应用程序?
我知道如果他们这样做,我可能不得不从框架中剥离拱门,但最好还是无法编译框架.
I know that if they do so, i might have to strip the arch from the framework, but it beats to not being able to compile the framework.
推荐答案
谢谢@RicardoDuarte;有我的 iPhone & 脚本模拟器.
Thank you @RicardoDuarte; There is my script for both iPhone & simulator.
Example_To=$BUILT_PRODUCTS_DIR"/"$PRODUCT_NAME".app/Frameworks/Example.framework/"
Example_From=$PROJECT_DIR"/../out/Build/Products/"$CONFIGURATION$EFFECTIVE_PLATFORM_NAME"/Example.framework"
mkdir -p $BUILT_PRODUCTS_DIR"/"$PRODUCT_NAME".app/Frameworks"
cp -Rv $Example_From $Example_To
if [[ $PLATFORM_NAME == 'iphoneos' ]]; then
CODE_SIGN_IDENTITY_FOR_ITEMS="${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
if [ "${CODE_SIGN_IDENTITY_FOR_ITEMS}" = "" ] ; then
CODE_SIGN_IDENTITY_FOR_ITEMS="${CODE_SIGN_IDENTITY}"
fi
codesign --force --verbose --sign "${CODE_SIGN_IDENTITY_FOR_ITEMS}" $Example_To
fi
我还添加了框架的路径
$(PROJECT_DIR)/../out/Build/Products/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
$(PROJECT_DIR)/../out/Build/Products/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
对于Framework Search Paths"和Header Search Paths",你的路径和框架名称当然可以不同.
to "Framework Search Paths" and "Header Search Paths", your's path and framework name can be different of course.
这篇关于xcode 使用 buildscript 添加嵌入式二进制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!