ios编译boost

来源:互联网 发布:java point类 编辑:程序博客网 时间:2024/04/28 21:08

下载解压到boost_1.55.0目录

cd boost_1.55.0

vi tools/build/v2/user_config.jam

在尾部添加:

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


using darwin : 6.1~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
   ;


然后执行

./booststrap.sh

export SDK_VERSION="6.1"

./bjam --prefix=/users/youname/boost --build-type=complete --layout=versioned toolset=darwin architecture=arm target-os=iphone macosx-version=iphone-${SDK_VERSION} define=_LITTLE_ENDIAN threading=multi install


编译simulator版本(1.53.0):

./bjam --prefix=/users/youname/boost --build-type=complete --layout=versioned toolset=darwin architecture=i386 target-os=iphone macosx-version=iphone-${SDK_VERSION} threading=multi install


编译osx版本:

./bjam --prefix=/users/youname/boost--build-type=complete --layout=versioned toolset=darwin cxxflags="-arch x86_64" linkflags="-arch x86_64" threading=multi install


cxxflags="-arch i386 -arch x86_64"可以得到32位64位通用库

可以使用lipo -info xxx.a来查看编译的到的库的类型


1 0
原创粉丝点击