How to detect target iOS architecture in qmake?

◇◆丶佛笑我妖孽 提交于 2019-12-13 08:25:47

问题


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:


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


来源:https://stackoverflow.com/questions/39338987/how-to-detect-target-ios-architecture-in-qmake

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!