😇
iOS、macOSでのlibpng、libjpeg、libtiff、libtiffxxの静的ライブラリBuildメモ
結論
iOS、mac用のlibpng.a、libjpeg.a、libtiff.a、libtiffxx.aの静的ライブラリはこれで、一発で作成できた。感謝。
makeするだけ。2024年3月23日、xcode 15.3
おしまい。
以下は読む必要がない。
経緯
2024年3月22日、久しぶりにlibpngをビルドしたら上手くいかない。
xcode 15.3。
libpngはここ。
cmakeによるbuildができると便利なのだけど、エラーとなった。
内容はcmake -G Xcode .
これもいい感じで途中まで動くけど、現状は作成できなかった。
xcodeとlibpng、どっちに問題があるのか、何の問題なのかよくわからなかった。
そこで、下を参考にコマンドで作った。
ダウンロードしたフォルダーでコマンドでconfigure
◇x86-64 simulator
./configure --prefix=`pwd`/install_x86_64_sim CFLAGS="-Ofast -mios-version-min=12.0" LDFLAGS="-flto" --host=x86_64-apple-darwin CC="xcrun -sdk iphonesimulator clang -arch x86_64"
make clean && make -j8 && make install
◇arm64 simulator
./configure --prefix=`pwd`/install_arm64_sim --enable-arm-neon=api CFLAGS="-Ofast -mios-version-min=12.0" LDFLAGS="-flto" --host=arm64-apple-darwin CC="xcrun -sdk iphonesimulator clang -arch arm64"
make clean && make -j8 && make install
◇arm64 device
./configure --prefix=`pwd`/install_arm64 --enable-arm-neon=api CFLAGS="-Ofast -mios-version-min=12.0" LDFLAGS="-flto" --host=arm64-apple-darwin CC="xcrun -sdk iphoneos clang -arch arm64"
make clean && make -j8 && make install
上と下はビルドできますが,真ん中のarm64 simulatorが上手くいかない。
エラーは、
checking for zlibVersion in -lz... no
checking for z_zlibVersion in -lz... no
configure: error: zlib not installed
自分は静的ファイルが欲しかったのでx86_64のシミュレーター版とarm64の実機版をlipoでくっつけて使った。
Discussion