问题描述
我使用qmake作为makefile生成器并希望遵守它。
此外,我想使用gcc -Wall -Werror -Wundef -Wextra来获得健壮的代码。
我正在考虑剽窃,但这是更进一步的道路。
我目前的主要问题是图书馆产生的大量警告,例如
提升,qt的一部分等。
目前每当我包含警告生成头文件时,我都会使用pragma。
#pragma忽略GCC诊断-Wall
#include< ; QtGui>
...
#include< QWidget>
#pragma GCC诊断错误-Wall
这远非可爱,相当乏味特别是其他程序员也必须这样做。
是否有使用qmake的选项允许将qt-libraries包含为系统头文件
,从而禁止它们的警告。对于普通的makefile和cmake,我知道 - 系统,但我找不到一个qmake挂件。
例如对于Boost,这在项目文件中看起来如下所示:
QMAKE_CXXFLAGS + = -isystem / usr / local / boost_1_44_0
I use qmake as a makefile builder and want to stick to it.Further I would like to use "gcc -Wall -Werror -Wundef -Wextra" to get robust code.I'm thinking about "-pedantic" but that's further up the road.My main problem at the moment are the tons of warnings generated by libraries likeboost, parts of qt and the like.
At the moment I use pragmas whenever I include warning-generating headers
#pragma GCC diagnostic ignored "-Wall"
#include <QtGui>
...
#include <QWidget>
#pragma GCC diagnostic error "-Wall"
This is far from cute, rather tedious and cumbersome especially as other programmers have to do so too.Is there an option using qmake that allows to include qt-libraries as system headers,thus supressing their warnings. For plain makefiles and cmake I knwow -isystem but I cannot find a qmake pendant for this.
Easiest way I found is including directly via QMAKE_CXXFLAGSe.g. for Boost this looks like the following in the project file
QMAKE_CXXFLAGS += -isystem /usr/local/boost_1_44_0
这篇关于使用qmake时,是否有可能通过-isystem传递包含?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!