HydrogenAudio

Lossless Audio Compression => FLAC => Topic started by: LeT0C on 2018-02-26 15:46:01

Title: Building libFLAC 1.3.2 for iOS
Post by: LeT0C on 2018-02-26 15:46:01
Hello,

I'd like to integrate FLAC support in an iOS audio app so I need to build libFLAC 1.3.2 for iOS targets, and I've been stuck on that for a while.

I tried to adapt Chris Ballinger's libOpus building script (https://github.com/chrisballinger/Opus-iOS/blob/master/build-libopus.sh), my build_libflac.sh (curretnly not working) is attached.

I managed to take care of the dependency on libogg by downloading and extracting libogg 1.3.3 and adding --with-ogg=${LIBOGGDIR} option to the configure call.

All 5 compilations run smoothly, but when it comes to the lipo part, I get the following error (I simpliflied the paths with [...] for readibility) :
Code: [Select]
lipo: [...]/iPhoneOS11.2-armv7.sdk/lib/libFLAC.a and [...]/iPhoneOS11.2-armv7s.sdk/lib/libFLAC.a have the same architectures (x86_64) and can't be in the same fat output file

I tried the lipo command with several couples of built architectures, I get the same error every time: same architectures (x86_64).

If this can be of any information, I get the following output at the end of configure with armv7, armv7s or arm64 :
Code: [Select]
-=-=-=-=-=-=-=-=-=-= Configuration Complete =-=-=-=-=-=-=-=-=-=-

  Configuration summary :

    FLAC version : ........................ 1.3.2

    Host CPU : ............................ arm
    Host Vendor : ......................... apple
    Host OS : ............................. darwin

    Compiler is GCC : ..................... no
    Compiler is Clang : ................... yes
    SSE optimizations : ................... yes
    Asm optimizations : ................... no
    Ogg/FLAC support : .................... yes

Any idea of how to get libFLAC built for iOS targets armv7, armv7s and arm64 ?

Thanks :)
Title: Re: Building libFLAC 1.3.2 for iOS
Post by: blahaha on 2018-04-05 21:59:39
Have you tried this library (https://github.com/imeace/FLACiOSC) from Github? It worked for me a couple of months back when I needed the FLAC library for iOS.