freetype-sys icon indicating copy to clipboard operation
freetype-sys copied to clipboard

Issue compiling for aarch64-apple-ios

Open DAddYE opened this issue 4 years ago • 0 comments

Hi,

I'm trying to compile the crate for ios, and when running the following command:

❯ cargo build --release --target=aarch64-apple-ios                        

I get:

  running: "cmake" "/Users/daddye/code/freetype-sys/freetype2" "-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE" "-DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE" "-DCMAKE_DISABLE_FIND_PACKAGE_PNG=TRUE" "-DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=TRUE" "-DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE" "-DCMAKE_INSTALL_PREFIX=/Users/daddye/code/freetype-sys/target/aarch64-apple-ios/release/build/freetype-sys-c6f1394b66138f11/out" "-DCMAKE_C_FLAGS= -fPIC --target=aarch64-apple-ios -arch arm64 -miphoneos-version-min=7.0 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk -fembed-bitcode" "-DCMAKE_C_COMPILER=/usr/bin/clang" "-DCMAKE_CXX_FLAGS= -fPIC --target=aarch64-apple-ios -arch arm64 -miphoneos-version-min=7.0 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk -fembed-bitcode" "-DCMAKE_CXX_COMPILER=/usr/bin/clang++" "-DCMAKE_ASM_FLAGS= -fPIC --target=aarch64-apple-ios -arch arm64 -miphoneos-version-min=7.0 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk -fembed-bitcode" "-DCMAKE_ASM_COMPILER=/usr/bin/clang" "-DCMAKE_BUILD_TYPE=Release"
  -- The C compiler identification is AppleClang 13.0.0.13000029
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - failed
  -- Check for working C compiler: /usr/bin/clang
  -- Check for working C compiler: /usr/bin/clang - broken
  -- Configuring incomplete, errors occurred!
  See also "/Users/daddye/code/freetype-sys/target/aarch64-apple-ios/release/build/freetype-sys-c6f1394b66138f11/out/build/CMakeFiles/CMakeOutput.log".
  See also "/Users/daddye/code/freetype-sys/target/aarch64-apple-ios/release/build/freetype-sys-c6f1394b66138f11/out/build/CMakeFiles/CMakeError.log".

  --- stderr
  CMake Error at /usr/local/share/cmake-3.21/Modules/CMakeTestCCompiler.cmake:69 (message):
    The C compiler

      "/usr/bin/clang"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: /Users/daddye/code/freetype-sys/target/aarch64-apple-ios/release/build/freetype-sys-c6f1394b66138f11/out/build/CMakeFiles/CMakeTmp
      
      Run Build Command(s):/usr/bin/make -f Makefile cmTC_6b07d/fast && /Applications/Xcode-beta.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_6b07d.dir/build.make CMakeFiles/cmTC_6b07d.dir/build
      Building C object CMakeFiles/cmTC_6b07d.dir/testCCompiler.c.o
      /usr/bin/clang   -fPIC --target=aarch64-apple-ios -arch arm64 -miphoneos-version-min=7.0 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk -fembed-bitcode  -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -mmacosx-version-min=11.5 -MD -MT CMakeFiles/cmTC_6b07d.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_6b07d.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_6b07d.dir/testCCompiler.c.o -c /Users/daddye/code/freetype-sys/target/aarch64-apple-ios/release/build/freetype-sys-c6f1394b66138f11/out/build/CMakeFiles/CMakeTmp/testCCompiler.c
      clang: error: invalid argument '-mmacosx-version-min=11.5' not allowed with '-miphoneos-version-min=7.0'
      clang: warning: overriding '-mmacosx-version-min=11.5' option with '--target=aarch64-apple-ios' [-Woverriding-t-option]
      clang: warning: using sysroot for 'MacOSX' but targeting 'iPhone' [-Wincompatible-sysroot]
      make[1]: *** [CMakeFiles/cmTC_6b07d.dir/testCCompiler.c.o] Error 1
      make: *** [cmTC_6b07d/fast] Error 2

I'm currently on BigSur, with Xcode 13, Cargo v0.15.0, and Rust v1.57.0-nightly

It seems it is passing both SDKs for ios and macos.

Any advice how to solve it?

Thanks again!

DAddYE avatar Sep 12 '21 22:09 DAddYE