qmake语言保留字问题(我认为)

qmake Language reserved word issue (I think)

为了提供一些背景信息,我正在使用静态插件 (http://doc.qt.io/qt-5/plugins-howto.html#static-plugins) 打包可执行文件。

在Windows,我做:

LIBS           = -L../../plugins -lrawplugin
LIBS           = -L../../plugins -lbasictools

if(!debug_and_release|build_pass):CONFIG(debug, debug|release)
   win32:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)d

if 语句负责在调试模式下将字母 d 添加到库名称中,例如文件名是 librawplugind.a

在 Mac OS 上,库被命名为 libbasictools_debug.a,所以我想我会在 [=] 中将 d 替换为 debug 12=] 语句:

if(!debug_and_release|build_pass):CONFIG(debug, debug|release)
   win32:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)debug

但是没有用。我猜是因为debug是qmake语言中的保留字

如何解决这个问题?

我认为这类似于qDebug() << "\"";中打印"的问题,其中"前面必须有\

qmake 语法不知道"if"。只需使用:

!debug_and_release|build_pass:CONFIG(debug, debug|release) {
   win32:LIBS = $$member(LIBS, 0) $$member(LIBS, 1)d
}