Qmake 中 win64 配置的标识符 [英] Identifier for win64 configuration in Qmake

查看:46
本文介绍了Qmake 中 win64 配置的标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Qmake 项目文件中是否有win64"标识符?Qt Qmake advanced 文档除了 unix/macx/win32 之外没有提及.

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:

win32:message("using win32")
win64:message("using win64")
amd64:message("using amd64")

结果总是使用 win32".

The result is always "using win32".

我是否必须为 x32 和 x64 项目使用单独的项目文件,以便它们可以针对正确的库进行编译?有没有其他方法可以区分 32 位和 64 位环境?

Must I use a separate project-file for x32 and x64 projects, so they would compile against correct libraries? Is there any other way to identify between 32-bit and 64-bit environments?

推荐答案

我就是这样做的

win32 {

    ## Windows common build here

    !contains(QMAKE_TARGET.arch, x86_64) {
        message("x86 build")

        ## Windows x86 (32bit) specific build here

    } else {
        message("x86_64 build")

        ## Windows x64 (64bit) specific build here

    }
}

这篇关于Qmake 中 win64 配置的标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆