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

后端 未结 2 1302
粉色の甜心
粉色の甜心 2020-12-29 00:04

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

2条回答
  •  死守一世寂寞
    2020-12-29 00:32

    Use a construction something like:

    CONFIG += 32bit
    
    CONFIG(32bit) {
        TARGET = 32bit_binary
        QMAKE_CXXFLAGS += -m32
        LIBS += -L
    }
    CONFIG(64bit) {
        TARGET = 64bit_binary
    }
    

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

提交回复
热议问题