Apple / MacOS / Universal Binary (x86_64 & arm64) build
I need help on Mac.
I'm working on MacOS Catalina (10.15.7) with XCode
I'm trying to build a UniversalBinary (x86_64 & arm64) package.
In my project I need icui18n(i18n), icuuc (common) and icudata (data) as dylibs in Release and debug.
Debug should be compiled on my mac target (x86_64 on Intel Mac, arm64 on Silicon Mac)
Release should be compiled as UniversalBinary (both x86_64 and arm64 targets)
On an Intel Mac I can't build the arm64 part
I tryed using XCode 12 Beta 5, XCode 12.2 Beta 3
On the same machine and same XCodes, I succeeded building openSSL, libzip and zlib opensource projects.
For those, I build x86_64 and arm64 targets and then using lipo I can get the UniversalBinary target
Is there a way to build UniversalBinary (x86_64&arm64) i18n, common and data targets on MacIntel ?
If not, is there a way to build arm64 target on x86_64 mac or x86_64 target on Silicon mac ?
In the makefile I got 4 steps
1 - Unpack in $(ICU_ROOT)
2- $(ICU_ROOT)/configure in $(ICU_ROOT)/build_ub
3- cd $(ICU_ROOT)/build_ub; make
I added a step between 2 and 3
Using sed it adds “ -arch x86_64 -arch arm64” to CC=clang and CXX=clang++ in $(ICU_ROOT)/build_ub/icudefs.mk
After that, the step 3 builds the universal binary tools and dylibs.
I tryed to export CC and CXX before the configure step but it seems configure overwitted’em.
Notice that the state of art XCode 12 Release can’t build arm64 part on a MacIntel today
On a MacIntel you’ll have to use XCode 12 Beta (tested with 12.2 Beta3)
I’m working using XCode 12 Beta 5 for Universal Binary (x86_64 & arm64) on MacOs 10.15.7 (Catalina) on an x86_64 Mac.
Which version of Xcode are you using?