Identifier for win64 configuration in Qmake

后端 未结 5 2059
南旧
南旧 2020-12-05 13:35

Is there a \"win64\" identifier in Qmake project files? Qt Qmake advanced documentation does not mention other than unix / macx / win32.

So far I\'ve tried using:

5条回答
  •  天命终不由人
    2020-12-05 13:59

    Since Qt5 you can use QT_ARCH to detect whether your configuration is 32 or 64. When the target is 32-bit, that returns i386 and in case of a 64-bit target it has the value of x86_64. So it can be used like:

    contains(QT_ARCH, i386) {
        message("32-bit")
    } else {
        message("64-bit")
    }
    

提交回复
热议问题