如何检查QT pro文件中的多个条件? 例如,如何在下面的代码段中添加多个条件。
DEFINES += QT_FORCE_ASSERTS
win32 {
CURR_PLATFORM = $$(CURR_PLATFORM) # read from environment
CURR_ARCH = $$(CURR_ARCH) # read from environment
!(equals(CURR_PLATFORM, "win32") && equals(CURR_ARCH, "x64")){
error(CURR_PLATFORM must be set to \"win32\" currently set to: \"$$(CURR_PLATFORM)\")
}
}
答案 0 :(得分:1)
将:
用作“和”,将|
用作“或”。但是,您不能将它们放在括号内。所以这行不通:
!(equals(CURR_PLATFORM, "win32") : equals(CURR_ARCH, "x64")) { ... }
您必须进行更改以消除括号:
!equals(CURR_PLATFORM, "win32") | !equals(CURR_ARCH, "x64") { ... }