0
votes

I have a Qt Version that supports following ABI's (Qt Creator → Preferences → Build & Run / Qt Versions):

  • arm-macos-generic-mach_o-32bit
  • arm-macos-generic-mach_o-64bit
  • x86-macos-generic-mach_o-32bit
  • x86-macos-generic-mach_o-64bit

So, combining in a Qt Kit this Qt Version with different compilers I can build libs for all mentioned architectures.

At the same time the mkspecs/qconfig.pri contains:

host_build {
    QT_ARCH = x86_64
    QT_TARGET_ARCH = arm
} else {
    QT_ARCH = arm
}

So, in a .pro file I can not detect a target architecture (it is always arm). I can check CONFIG for iphonesimulator value and so detect arm/not arm architecture but there is still 32bit/64bit issue.

Is there a way to distinguish armv7/arm64/... builds in qmake (.pro file)?

1
For what reason do you need to distinguish them? I mean, for qmake system's pro files it's better to be as much crossplatform as possible. Btw, you can explicitly set build configuration, like this: Add a target/build type in the Qt Creator, like ios-armv7; Also add something like CONFIG += ios-armv7 to it's arguments. Now you can perform architecture-specific actions in your .pro: ios-armv7 { ... }Sergey Belash
I need to do specific post-build jobs (that depend on arch type) such as sign and deploy installer, run specific VMs and launch tests...Dmitry Sokolov

1 Answers

0
votes

The only method I found is:

Qt Creator → Preferences → Build & Run / Kits → Environment → Change...

Than set specific IOS_ARCH env var for each kit.

In .pro file:

IOS_ARCH = $$(IOS_ARCH)
!isEmpty(IOS_ARCH): TARGET_ARCH = $$IOS_ARCH
# then use $$TARGET_ARCH as usual