[Qt-interest] QMake depend_command: does that work?

Christophe de Dinechin christophe at taodyne.com
Thu Sep 2 16:10:28 CEST 2010


We have a couple of files that trip a bug in g++ when compiled at -O2. So I have added a new "compiler" as described in http://doc.qt.nokia.com/4.6/qmake-environment-reference.html with the intent to lower the optimization for these files. Here is what it looks like:

c++tbl.output = ${QMAKE_FILE_BASE}.o
c++tbl.commands = $(CXX) -c $(CXXFLAGS:-O2=-g) $(INCPATH) ${QMAKE_FILE_NAME} -o ${QMAKE_FILE_OUT}
c++tbl.depend_command = $(CXX) -E -M $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_NAME} | sed "s/^.*: //"
c++tbl.input = CXXTBL_SOURCES
QMAKE_EXTRA_COMPILERS += c++tbl

This works as intended as far as compilation goes, but I noticed that it no longer builds the dependencies correctly. Looking in the source code for qmake, I verified that .depend_command is the right name to use. I tried manually adding dependencies with

c++tbl.depends = test_dependency

This works. Still, .depend_command doesn't.

Any idea why depend_command doesn't work as intended in this case? Should I file a bug report?





More information about the Qt-interest-old mailing list