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:(https://github.com/google/libphonenumber/)

  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")
  set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
  set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")
  set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
endif ()

To this:

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

  1. I then run cmake, such as:
cmake \
-CMAKE_SYSTEM_NAME=iOS \
-CMAKE_OSX_ARCHITECTURES=x86_64 \
-CMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneOS13.5.sdk \
-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 \
-DUSE_STD_MAP=ON 
  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.