How to determine the target iOS architecture in qmake?

I have a Qt version that supports the following ABIs (Qt Creator -> Preferences -> Build and Run / Qt Versions):

  • hand-macOS-generic-mach_o-32bit
  • hand-macOS-generic-mach_o-64bit
  • x86-macOS-generic-mach_o-32bit
  • x86-macOS-generic-mach_o-64bit

So, by combining this Qt version with different compilers in Qt Kit, I can create libraries for all mentioned architectures.

At the same time it mkspecs/qconfig.pri

contains:

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

      

So, in the file, .pro

I cannot find the target architecture (it always is arm

). I can check CONFIG

for iphonesimulator

value and therefore detect arm / not arm architecture but still 32bit / 64bit issue.

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

0


source to share


1 answer


The only method found:

Qt Creator -> Preferences -> Build and Run / Kits -> Environment -> Edit ...

Setting a specific IOS_ARCH

env var for each set.



In the file .pro

:

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

      

0


source







All Articles