Skip to content

vcmi/vcmi-ios-deps

 
 

Repository files navigation

VCMI dependencies for iOS

NB: the following instructions are for legacy dependencies that are no longer updated. You can still use them if you have Xcode 11/12 or to build for simulator / armv7 device. The recommended way is to use Conan package manager.

Library dependencies for iOS platform of VCMI project.

Current status:

  • all dependencies target iOS 10.0 and are available for both 32- and 64-bit
  • both 64-bit simulators (Intel and ARM) are supported, the 32-bit one is not (although it should be possible to build for it)

Using prebuilt package

Download prebuilt libraries (they were created with GitHub Actions), unpack the archive and run fix_install_paths.command script (either by double-clicking it or from Terminal). Full build instructions are available on VCMI wiki.

If you move the unpacked directory later, you also need to run the script, as it fixes absolute paths in Boost's CMake config files.

Note for ARM Macs

Qt is built on an Intel host, hence host Qt tools (MOC, UIC etc.) are x86_64. If you want to obtain their native versions (for example, you don't want to use Rosetta), you need to configure Qt manually and then build only those tools.

  1. Download and unpack qtbase module. Note that the link is for v5.15.5, replace the version as needed.
  2. From some build directory execute:
PATH/TO/DOWNLOADED/QTBASE/configure -opensource -confirm-license -release -no-debug-and-release -static -no-framework -nomake examples -no-compile-examples -no-freetype -no-harfbuzz -no-gif -no-ico \
  && make --silent --jobs=$(sysctl -n hw.ncpu) sub-src-qmake_all \
  && make --silent --jobs=$(sysctl -n hw.ncpu) --directory=src sub-bootstrap sub-moc sub-qlalr sub-rcc sub-tracegen sub-uic
  1. The host tools will appear in bin directory inside your build directory. Copy them to either:
  • both build/iphoneos/bin and build/iphonesimulator/bin directories of the prebuilt package
  • some directory on your machine and symlink all tools to both build/iphoneos/bin and build/iphonesimulator/bin directories of the prebuilt package
  1. You can safely delete build directory and Qt directory.

Building from source

Xcode is required to build the dependencies. Build has been tested with the following Xcode versions: 13.4.1, 13.2.1, 12.5.1, 12.4, 11.3.1.

Make sure that xcodebuild command is available. If it's not, use either of the following ways:

  • select an Xcode instance from Xcode application - Preferences - Locations - Command Line Tools
  • use xcode-select utility to set Xcode path: for example, sudo xcode-select -s /Applications/Xcode.app
  • set DEVELOPER_DIR environment variable pointing to Xcode path: for example, export DEVELOPER_DIR=/Applications/Xcode.app

Clone this repository with submodules. Then simply run ./build_depends.sh and wait, the result will appear in build directory.