如何删除qmake中的alter默认CFLAGS



我正在使用qmake/make来构建一个库。目前,构建正在运行,但我们无法使用生成的库。

qmake生成这个Makefile:

CFLAGS        = -Wall -pedantic -fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -O2 $(DEFINES)
CXXFLAGS      = -Wall -pedantic -fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -O2 $(DEFINES)

当修改Makefile并使用这些选项时,它可以工作:

CFLAGS        = -Wall -pedantic -fPIC
CXXFLAGS        = -Wall -pedantic -fPIC

我的.pro文件包含以下信息:

TEMPLATE = lib subdirs
CONFIG = create_prl staticlib
QMAKE_CXXFLAGS = -Wall -pedantic -fPIC
QMAKE_CFLAGS = -Wall -pedantic -fPIC
# and Sources + headers

问题是如何告诉qmake只生成所需的标志?(即-Wall -pedantic -fPIC

我成功地使用以下命令删除了所有标志:

QMAKE_CXXFLAGS_RELEASE = -Wall -pedantic -fPIC
QMAKE_CFLAGS_RELEASE = -Wall -pedantic -fPIC

最新更新