Using QMAKE to build a both 32 and 64 bits versions of project

别来无恙 提交于 2019-11-30 04:14:22

Use a construction something like:

CONFIG += 32bit

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

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

Make use of win32: in front of each command you would like be run for win32 architecture only. Or can use a scope as

win32 {
     SOURCES += paintwidget_win.cpp
 }

Also, you may refer to the architecture win32 or x64 with the ($Platform) MSDN macro for Visual Studio.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!