windows - Qmake 中 win64 配置的标识符

标签 windows qt 64-bit qt4 qmake

Qmake 项目文件中是否有“win64”标识符? Qt Qmake advanced文档没有提到 unix/macx/win32 以外的内容。

到目前为止,我已经尝试使用:

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

结果总是“使用 win32”。

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

最佳答案

我是这样做的

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

    }
}

关于windows - Qmake 中 win64 配置的标识符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/356666/

相关文章:

windows - webpack 编译时有警告,但警告信息是空白的

c++ - 我在哪个时区初始化 QDateTime?

perl - 在 32 位 perl 中使用 64 位整数和十六进制

c# - 检测 32 位或 64 位

c++ - C++如何知道如何转换为特定类型?

c++ - 如何获得从资源文件生成的 Win32 对话框的视觉主题?

c# - 如何拦截 Windows 中物理电源按钮的按下?

c# - 'System.Management.Automation.Runspaces.InitialSessionState' 的类型初始值设定项抛出异常

c++ - 在无限循环中暂停 QThread

qt - 从绝对文件路径使用分层结构填充 QTreeWidget