boost交叉编译之iOS

it appears that two of the boost libraries fail (one of them is threading-multi) but I guess ogre doesn't use them so thats fine.

Create a user configuration file

/Users/User-Name/user-config.jam

using darwin : 6.0~iphone
: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 -arch armv7 -mthumb -fvisibility=hidden -fvisibility-inlines-hidden
: <striper>
: <architecture>arm <target-os>iphone
;
using darwin : 6.0~iphonesim
: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -arch i386 -fvisibility=hidden -fvisibility-inlines-hidden
: <striper>
: <architecture>x86 <target-os>iphone
;

Actually use this one for now

using darwin : 6.0~iphone
: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 -arch armv7
: <striper>
: <architecture>arm <target-os>iphone
;
using darwin : 6.0~iphonesim
: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -arch i386
: <striper>
: <architecture>x86 <target-os>iphone
;

run bootstrap.sh

./bootstrap.sh

build armv7

export SDK_VERSION="6.0"
./bjam --prefix=/users/User_Name/boost_arm_output toolset=darwin variant=release architecture=arm target-os=iphone macosx-version=iphone-${SDK_VERSION} define=_LITTLE_ENDIAN link=static install

build i386

export SDK_VERSION="6.0"
./bjam --prefix=/users/User_Name/boost_i386_output toolset=darwin variant=release architecture=x86 target-os=iphone macosx-version=iphonesim-${SDK_VERSION} link=static install

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
NDK交叉编译Boost是将Boost库编译成适用于Android平台的库文件,以便在Android应用中使用Boost库的功能。下面是一般的NDK交叉编译Boost的步骤: 1. 下载NDK:首先,你需要下载并安装Android NDK,可以从官方网站(https://developer.android.com/ndk/downloads)上获取最新版本的NDK。 2. 下载Boost库:接下来,你需要下载Boost库的源代码。你可以从Boost官方网站(https://www.boost.org/users/download/)上下载最新版本的Boost库。 3. 配置Boost库:解压下载的Boost源代码,并进入解压后的目录。在终端中执行以下命令来配置Boost库: ``` ./bootstrap.sh --with-libraries=<library_names> --with-toolset=<toolset_name> --prefix=<install_path> ``` 其中,`<library_names>`是你需要编译的Boost库的名称,可以根据你的需求进行选择;`<toolset_name>`是你要使用的编译工具链,例如`clang`或`gcc`;`<install_path>`是你希望安装Boost库的路径。 4. 编辑user-config.jam文件:在Boost源代码目录下,创建一个名为`user-config.jam`的文件,并添加以下内容: ``` using clang : <ndk_version> : <path_to_ndk>/toolchains/llvm/prebuilt/<host_os>/bin/clang++ ; ``` 其中,`<ndk_version>`是你下载的NDK的版本号,`<path_to_ndk>`是你安装NDK的路径,`<host_os>`是你的操作系统类型(例如`darwin-x86_64`或`linux-x86_64`)。 5. 开始编译Boost库:在终端中执行以下命令来开始编译Boost库: ``` ./b2 toolset=clang-<ndk_version> target-os=android link=static threading=multi variant=release install ``` 这将使用指定的编译工具链和选项来编译Boost库,并将编译结果安装到之前配置的安装路径中。 6. 完成编译:等待编译过程完成,然后你将在之前配置的安装路径中找到编译好的Boost库文件。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值