使用 QMAKE 构建 32 位和 64 位版本的项目 [英] Using QMAKE to build a both 32 and 64 bits versions of project

查看:55
本文介绍了使用 QMAKE 构建 32 位和 64 位版本的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要生成 32 位版本的应用程序,但是我正在 64 位操作系统上进行编译.我正在寻找一种方法让 QMake 生成我的应用程序的 32 位和 64 位版本.如果这是不可能的,我想知道如何切换到 32 位.我还想避免弄乱生成的 makefile.

I need to generate a 32 bits version of my application however I am compiling on a 64 bits OS. I'm looking for a way to make QMake to generate both 32 and 64 bits versions of my application. If this is not possible I would like to know how to switch to 32 bits. I would also like to avoid having to mess with the generated makefile.

推荐答案

使用类似的结构:

CONFIG += 32bit

CONFIG(32bit) {
    TARGET = 32bit_binary
    QMAKE_CXXFLAGS += -m32
    LIBS += -L<path to 32bit libraries>
}
CONFIG(64bit) {
    TARGET = 64bit_binary
}

在您的 .pro 文件中.那么你只需要改变一行就可以为另一种架构重新编译.

in your .pro file. Then you only need to change one line to recompile for the other architecture.

这篇关于使用 QMAKE 构建 32 位和 64 位版本的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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