Nob*_*bik 16 iphone boost build
有人能告诉我,在哪里可以找到详细的指南,如何构建Boost-Libraries以便在iPhone-Device上使用它.
我已经为Mac构建了libs,可以在我的项目中使用它们(仅限iPhone-Simulator).在为iPhone-Device构建项目时,XCode给我一个警告:"文件不是必需的架构",还有其他一些错误.
请帮忙
对于只有头文件 (.hpp) 的 boost 库,您只需设置从项目到它们的头搜索路径。
对于带有源代码的 boost 库,您可以通过以下简单步骤为 ios 手机/模拟器构建静态库:
下载并解压 boost 版本存档(来自https://www.boost.org/users/download/),例如:https: //boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0。压缩包bz2
使用所需的库运行bootstrap.sh来构建例如“上下文”(格式=library1,library2,...):
./bootstrap.sh --with-libraries=context
Run Code Online (Sandbox Code Playgroud)
project-config.jam:# IOS ARM64
using clang : iphoneos
: xcrun clang -arch arm64 -stdlib=libc++ -std=c++11 -miphoneos-version-min=12.0 -fvisibility-inlines-hidden -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
;
# IOS x86_64
using clang : iphonesimulator
: xcrun clang -arch x86_64 -stdlib=libc++ -std=c++11 -miphoneos-version-min=12.0 -fvisibility-inlines-hidden -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
;
Run Code Online (Sandbox Code Playgroud)
libboost_<name>.a):lib=libboost_context.a
dir='stage/lib'
# Build arm64
./b2 -a -j4 toolset=clang-iphoneos binary-format=mach-o abi=aapcs link=static stage
mv $dir/$lib $dir/arm64_$lib
# Build x86_64
./b2 -a -j4 toolset=clang-iphonesimulator binary-format=mach-o abi=sysv link=static stage
mv $dir/$lib $dir/x86_64_$lib
# Make fat
lipo -create $dir/arm64_$lib $dir/x86_64_$lib -output $dir/$lib
Run Code Online (Sandbox Code Playgroud)
现在,您已经在“/stage/lib”目录中编译了用于 boost context:arm64_libboost_context.a和x86_64_libboost_context.afat one 的静态库libboost_context.a。
| 归档时间: |
|
| 查看次数: |
8606 次 |
| 最近记录: |