Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. iOS static lib for iPhone and Simulator with M1. How?
Forum Update on Monday, May 27th 2025

iOS static lib for iPhone and Simulator with M1. How?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
2 Posts 1 Posters 544 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bogong
    wrote on last edited by bogong
    #1

    Hello!

    When used XCode on M1 Macbook/iMac the static library build for iPhone arm64 and for Simulator fat lib of arm64 and x86-64 arch. Before M1 appearing for building universal library just run "lipo" and all is good. For now when trying to make fat library "lipo" not working because of equal arch in files for different platforms. Does anyone know how to make universal static lib with XCode that will be Ok for both of platforms (x86-64 and arm64/M1) on Simulator and (arm64) on iPhone?

    Or how to make different config with QMake one for M1 Simulator, one for x86-64 Simulator and one for iPhone?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bogong
      wrote on last edited by bogong
      #2

      Solution found. Separate building of static library for every version of any platform and attaching it to the project in qmake by detecting it via qmake test functions. Something like this:

      CONFIG(iphoneos,iphoneos|iphonesimulator):message(Detect iphoneos)
      CONFIG(iphonesimulator,iphoneos|iphonesimulator):message(Detect iphonesimulator)
      
      equals(QMAKE_HOST.arch, arm64):message(Detect arm64)
      equals(QMAKE_HOST.arch, x86_64):message(Detect x86_64)
      

      For now built in XCode Objective-C static library with different parameters for:

      • M1 arm64 Simulator
      • Intel x86_64 Simulator
      • arm 64 iPhone
      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved