我尝试了命令here,但我没有通过第一个命令,我得到了这个
FreeType build system — automatic system detection
The following settings are used:
platform unix compiler cc
configuration directory ./builds/unix configuration rules
./builds/unix/unix.mkIf this does not correspond to your system or settings please remove
the file `config.mk’ from this directory then read the INSTALL file
for help.Otherwise,simply type
/Applications/Xcode.app/Contents/Developer/usr/bin/make' again to
/Applications/Xcode.app/Contents/Developer/usr/bin/make refdoc’ to
build the library,or
build the API reference (this needs python >= 2.6).cd builds/unix; \
./configure ‘CFLAGS=-arch i386’ /bin/sh: ./configure: No such file or directory make: *** [setup] Error 127
我也按照cmakelists.txt里面的说明进入项目内部,但仍然没有,我仍然得到一个osx的xcode项目而不是IOS,这给了我很多的链接错误.以下是供您参考的说明.
For an iOS static library,use
#cmake -D IOS_PLATFORM=OS -G Xcode
#
or
#
cmake -D IOS_PLATFORM=SIMULATOR -G Xcode
我不知道还能做什么.有帮助吗?
解决方法
>下载最新的FreeType source code
>解压缩归档并cd到unarchived目录中
>为所需的体系结构设置工具链和导出变量(arm64,arm7,i386,x86_64)
>编译源代码并构建库
例如,arm64的构建命令可能如下所示:
$export CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" $iphoneos="7.0" # target version of iOS $ARCH="arm64" # architecture (arm64,x86_64) $export CFLAGS="-arch ${ARCH} -pipe -mdynamic-no-pic -Wno-trigraphs -fpascal-strings \ -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden \ -miphoneos-version-min=$iphoneos -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2 \ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk" $export AR="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar" $export LDFLAGS="-arch ${ARCH} -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk \ -miphoneos-version-min=7.0" $./configure --host="aarch64-apple-darwin" --enable-static=yes --enable-shared=no $make $clean
It’s a bit of work to construct the commands for each arch,but
fortunately 07001
— which automatically downloads,extracts,and builds the latest FreeType (2.6.5 currently).
要运行脚本,只需在终端中使用以下命令:
./build_freetype.sh
生成的iOS库在完成后可以在〜/ Desktop / FreeType_iOS_Release中找到.