1

我试图让 qmake 生成一个包含-arch i386在 CFLAGS/LFLAGS 中的生成文件,但到目前为止我还没有成功。我尝试了以下方法:

  • CONFIG-=x86
  • QMAKE_CFLAGS-="-arch i386"

以及其他一些变体。唯一有效的方法是移除x86.prfmkspecs/features/mac但我认为这不是一个合适的解决方案。

当前命令行大致如下所示:

qmake -makefile -nocache CONFIG-=release CONFIG+=Debug CONFIG+=mac 
 CONFIG+=CMDMAKE CONFIG-=x86 CONFIG+=x64 
 QMAKE_MAKEFILE=makefile_mac_Debugx64 QMAKE_LFLAGS="<...>"
 QMAKE_CXXFLAGS="<..>" QMAKE_CFLAGS="<...>" QTVER=4.8.4 project.pro
4

2 回答 2

1

I believe that qmake uses the compiler available in the PATH. If you want to use x86_64 compiler, alter PATH (and possibly INCLUDE, LIB and LIBPATH) environment variables for x86_64 compiler to be available, and then run qmake.

于 2013-06-12T18:09:07.010 回答
0

暂定解决方案(需要验证一些事情来确认它,但似乎有效):

1) 为 x64 单独构建 Qt,即:

./configure -platform macx-g++42 -arch x64 -debug-and-release <...>

2) 使用qmake版本生成 x64 生成文件。

它显然仍然需要CONFIG-=x86,但这看起来足以防止-arch i386生成的 makefile 中出现杂散。

于 2013-06-12T18:35:05.963 回答