Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for catalyst target #20

Open
sbarex opened this issue Jan 22, 2021 · 1 comment
Open

add support for catalyst target #20

sbarex opened this issue Jan 22, 2021 · 1 comment

Comments

@sbarex
Copy link

sbarex commented Jan 22, 2021

Please add support for catalyst target.

I think the arch is x86_64h, target is x86_64-apple-ios14.3-macabi.
But I do not know which host... x86_64?

@sbarex
Copy link
Author

sbarex commented Jan 28, 2021

Right now I am able to compile libjpeg:

cd jpeg-9d
mkdir catalyst
cd catalyst
 
CXX="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ --target=x86_64-apple-ios14.3-macabi" CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang --target=x86_64-apple-ios14.3-macabi" CFLAGS="-O3 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/iOSSupport/System/Library/Frameworks" LDFLAGS="-target x86_64-apple-ios14.3-macabi -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/iOSSupport/usr/lib -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/iOSSupport/System/Library/Frameworks" CXXFLAGS="$CFLAGS -Wno-deprecated-register" ../configure --prefix=`pwd` --disable-dependency-tracking --enable-static=yes --enable-shared=no

make install

But compiling libtiff doesn't quite work for now:

cd tiff-4.2.0
mkdir catalyst
cd catalyst

CXX="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ --target=x86_64-apple-ios14.3-macabi" CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang --target=x86_64-apple-ios14.3-macabi" CFLAGS="-O3 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/iOSSupport/System/Library/Frameworks" LDFLAGS="-target x86_64-apple-ios14.3-macabi  -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/iOSSupport/usr/lib -iframework /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/iOSSupport/System/Library/Frameworks" CXXFLAGS="$CFLAGS -Wno-deprecated-register" ../configure --prefix=`pwd` --disable-dependency-tracking --enable-static=yes --enable-shared=yes --with-zlib-lib-dir=/usr/lib/libz.1.dylib --with-jpeg-include-dir=../../jpeg-9d/catalyst/include --with-jpeg-lib-dir=../../jpeg-9d/catalyst/lib

make install

The static library imported into Xcode fails with error: In libtiff.a(tif_close.o), building for Mac Catalyst, but linking in object file built for iOS Simulator, for architecture x86_64.

I believe that some libraries (libz?) compiled for mac and not for catalyst are linked during compilation.

The dylib library is working, but remember to change the upload path:

install_name_tool -id '@rpath/libtiff.5.dylib' libtiff.5.dylib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant