gpt4 book ai didi

freetype2 - 为 IOS 编译 Freetype 2.6.5 Xcode

转载 作者:行者123 更新时间:2023-12-04 14:41:18 24 4
gpt4 key购买 nike

好吧,伙计们,我发布了一个类似的问题并将其删除,因为它不够具体,所以我走了。来自 Freetype 2.6.5 的 zip 文件我无法创建一个 Xcode 项目来编译 iOS 使用的库,只能用于 i386_64。

我尝试了命令 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.mk

If 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
build the library, or
/Applications/Xcode.app/Contents/Developer/usr/bin/make refdoc' to 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 而不是 IOS 的 xcode 项目,这给了我过多的链接错误。这是供您引用的说明。

For an iOS static library, use #

cmake -D IOS_PLATFORM=OS -G Xcode

#

or

#

cmake -D IOS_PLATFORM=SIMULATOR -G Xcode



我不知道还能做什么。有什么帮助吗?

最佳答案

以下是为 iOS 编译 FreeType 库的基本构建过程的概述:

  • 下载最新FreeType source code
  • 将存档和 cd 解压到未存档目录
  • 为所需的架构设置工具链和导出变量(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, arm7, i386, 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 there's a build script — which automatically downloads, extracts, and builds the latest FreeType (2.6.5 currently).



    要运行脚本,只需在终端中使用以下命令:
    ./build_freetype.sh

    生成的 iOS 库可以在 ~/Desktop/FreeType_iOS_Release 中找到。当它完成时。

    关于freetype2 - 为 IOS 编译 Freetype 2.6.5 Xcode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38406356/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com