由网友(国际事逼)分享简介:我必须做这样的事情在一个.pro文件:I have to do something like this in a .pro file:win32 {LIBS += -L../3rdparty/libusb-win32/lib/msvc -llibusb} elsewin64 {LIBS += -L../3rdp...
我必须做这样的事情在一个.pro文件:
I have to do something like this in a .pro file:
win32 {
LIBS += -L../3rdparty/libusb-win32/lib/msvc -llibusb
} else
win64 {
LIBS += -L../3rdparty/libusb-win32/lib/msvc_x64 -llibusb
}
现在的问题是这是行不通的,它总是链接的Win32库。 有什么建议?
The problem is it doesn't work, it always links win32 library. Any suggestions?
推荐答案
您可以使用 QT_ARCH
变量来检测你的配置是32或64:
You can use QT_ARCH
variable to detect whether your configuration is 32 or 64 :
contains(QT_ARCH, i386) {
message("32-bit")
}else {
message("64-bit")
}
当目标是32位的,变量返回 386
键,如果一个64位的目标它有 x86_64的。
When the target is 32-bit, the variable returns i386
and in case of a 64-bit target it has the value of x86_64
.
相关推荐
最新文章