How to build libphonenumber (from Google) for an iOS app?

Due to troubles with Kotlin's Cocoapod gradle plugin.

I've struggled for 2 days now trying to build libphonenumber for iOS app:(

  1. I've cloned the repo locally.

  2. I used the following command: brew install boost cmake icu4c pkg-config protobuf wget

Note: icu4c failed to install the lastest. So I did the following to upgrade 'icu4c' brew upgrade icu4c

From the location: ~/Downloads/libphonenumber/cpp. I do the following:

  1. Modify CMakeLists.txt From this:
if (32BIT)
  set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
endif ()

To this:

#if (32BIT)
  set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
#endif ()

  1. I then run cmake, such as:
cmake \
-CMAKE_OSX_SYSROOT=/Applications/ \
-DGTEST_SOURCE_DIR=~/Documents/googletest/googletest/ \
-DGTEST_INCLUDE_DIR=~/Documents/googletest/googletest/include/ \
-DICU_UC_INCLUDE_DIR=/usr/local/Cellar/icu4c/67.1/include/ \
-DICU_UC_LIB=/usr/local/Cellar/icu4c/67.1/lib/libicuuc.dylib \
-DICU_I18N_INCLUDE_DIR=/usr/local/Cellar/icu4c/67.1/include/ \
-DICU_I18N_LIB=/usr/local/Cellar/icu4c/67.1/lib/libicui18n.dylib \
  1. I then run: make Which builds libphonenumber.a

  2. I then run tests against the library, which passes: ./libphonenumber_test This passes.

So, it looks like I need to modify: -CMAKE_OSX_ARCHITECTURES=x86_64

To specify the armv7, armv7s, arm64 and arm64e and so forth, right? Anything else that I'm missing? Simulator?

I'm using Xcode 11.5.